-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Hi, im trying to get this container running as a stack in docker-compose.
First of all thanks for creating and mainting this docker image.
I wanted to ask if you could rework the documentation/setup tutorial? Its very hard for someone new to docker to get this setup running as the instructions from dockerhub and github are confusing and non-coherent. On dockerhub the documentation talks about files like entry_<email>.lua which then is nowhere to be found in the github for the project.
-
On dockerhub you don't tell the user that
<email>has to be replaced with something different. For you its obvious, but you have to be more precise in the instructions. Really every step has to be precise in how to setup this and get this running. linuxserver.io does a pretty good job in explaining every detail on how to use a container. I would really appreciate if you could update the instructions. -
Don't assume the default setup is someone using a git repo for their imapfilter config. The default should be someone having a local config file which needs to be mounted into the container. The documentation isn't very clear about what "absolute path to config" or "base of mounted config" in IMAPFILTER_CONFIG and IMAPFILTER_CONFIG_BASE means. Are these paths for inside the container or paths where i just put in the hosts path to the config file? I figured out i had to bind mount my config path as a volume to the internal path "/opt/imapfilter/config" and then just set the name of the config file in IMAPFILTER_CONFIG. It took me quite a while and wasn't easy to figure that out.
-
Don't assume people use docker swarm, and therefore have the ability to use secrets. Most people safe the passwords in config files. And for docker compose there's a workaround for secrets without swarm. https://devops.stackexchange.com/questions/12101/secrets-in-docker-without-swarm
Here's my docker-compose as a reference. Maybe this could be helpful for updating the default docker-compose file. Could you please the change default way of this container to local mounted config file with pw in config file with github and docker secrets being opt in? I think thats what most users use when they start with imapfilter before they switch to hosting their imapfilter configs in an github repo.
---
version: '3.4'
secrets:
#imapfilter-git_token:
# external: true
# contains the password for the email
#imapfilter-email1:
# external: true
imapfilter-email1:
file: /dockerdata/persistent/imapfilter/email1/secret_email1.txt
services:
email1:
image: ntnn/imapfilter
environment:
#GIT_TARGET: <git uri>
IMAPFILTER_CONFIG: daemon_mail1.lua
IMAPFILTER_DAEMON: 'yes'
#GIT_USER: <git tool user>
#GIT_TOKEN: /secrets/imapfilter-token
volumes:
- /dockerdata/persistent/imapfilter/email1:/opt/imapfilter/config
secrets:
#- source: imapfilter-git_token
# target: /secrets/imapfilter-token
- source: imapfilter-email1
target: /secrets/imapfilter-email1
deploy:
mode: global
Now the actual lua-error im getting when running the lua config from the github.
>>> Sleeping
imapfilter: ./lib.lua:36: attempt to call global 'log' (a nil value)
stack traceback:
./lib.lua:36: in function 'spam'
./daemon.lua:8: in function 'apply_rules'
./daemon.lua:13: in function 'daemon'
daemon_mail1.lua:10: in main chunk
>>> imapfilter daemon died, exiting
What is the problem here? Is the log() function missing or what do i need to do to fix this and get it running? Can you please update the lua files in the github repo to work out of the box?
Thank you very much in advance
Greetings to Ludwigshafen