docker-mailserver: After host reboot (and some container restarts) dovecot fails to run correctly
I have docker-mailserver setup and running, sending and receiving emails as expected, but sometimes after a server reboot, or a docker-compose restart, dovecot appears to break. The docker log gets flooded with the following lines every second until I stop or restart the container (hopefully working on the second try).
INFO spawned: 'dovecot' with pid 1099
INFO success: dovecot entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
INFO exited: dovecot (exit status 89; not expected)
INFO spawned: 'dovecot' with pid 1101
INFO success: dovecot entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
INFO exited: dovecot (exit status 89; not expected)
INFO spawned: 'dovecot' with pid 1103
INFO success: dovecot entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
INFO exited: dovecot (exit status 89; not expected)
I also see the following line in the log at sporadic places.
mail dovecot: master: Fatal: Dovecot is already running with PID 203 (read from /var/run/dovecot/master.pid)
The strange thing is that even though it says dovecot is running, I cannot connect any accounts over IMAP.
Here is my docker-compose.yml
version: '2'
services:
mailserver:
image: tvial/docker-mailserver:latest
restart: always
hostname: mail
domainname: example.com
container_name: mail.example.com-mailserver
ports:
- "25:25"
- "587:587"
- "993:993"
volumes:
- ./mailserver/maildata/:/var/mail
- ./mailserver/mailstate/:/var/mail-state
- ./mailserver/config/:/tmp/docker-mailserver/
- /home/justin/docker/nginx-proxy/certificates/:/etc/letsencrypt/live
environment:
- ONE_DIR=1
- SSL_TYPE=letsencrypt
- DMS_DEBUG=1
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 32 (19 by maintainers)
FOUND the cause. There is a daily cron job /etc/cron.daily/spamasassin When you run it you get the loop:
And there is a post hook in: /etc/spamassassin/sa-update-hooks.d/amavisd-new It inits a restart and that causes it to detach from supervisor.
Made a PR to fix the issue see #699
Great! And thank @johansmitsnl
Merged,
latest
is currently building.