Context
Using the recommended volume configuration won't save your mail queue from restarts:
https://github.com/tomav/docker-mailserver/blob/f225e14a219824e4ebb34e63b144e6d7c1314bcb/docker-compose.yml.dist#L13-L17
What is affected by this bug?
Deferred mails in queue will not be resent after a reboot or container rebuild.
When does this occur?
When some mail gets deferred and queued and, later, you reconfigure your container (quite common for fixing some kind of problem, like a relay password that has changed), the mail queue is lost.
How do we replicate the issue?
-
Configure with SMTP_ONLY=1 and some DEFAULT_RELAY_HOST that makes the sent mails fail. The failure might be a wrong password or (in the case below) a wrong TLS setting.
-
Send a mail.
-
Execute postqueue -p in the container. You'll see an output similar to:
$ docker-compose exec smtp postqueue -p
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
2F68C223A6C 3701 Tue Aug 4 11:30:32 [email protected]
(TLS is required, but was not offered by host 10.0.0.1[10.0.0.1])
[email protected] 4.
-
Fix the problem.
-
Rebuild with docker-compose up -d --force-recreate
-
Execute postqueue -p in the container.
Actual Behavior
The new mail queue will be empty.
Running this command seems to explain why:
$ postconf -p queue_directory
queue_directory = /var/spool/postfix
That's the directory where mail queue is stored, and it's not in any volume.
Expected behavior (i.e. solution)
The queue should be stored under /var/mail-state/spool-postfix. Or /var/spool/postfix should be a recommended mount point. Or maybe even /var/spool? Because this command shows that it's used also somewhere else:
$ postconf -p | grep /spool
queue_directory = /var/spool/postfix
smtpd_sasl_path = /var/spool/postfix/private/auth
Your Environment
- Amount of RAM available: 8GiB
- Mailserver version used: If the
org.label-schema.vcs-ref label is right, it points to f225e14. In any case, the exact image is sha256:701355354a94a936006df1e7635eec5fff2cedf166c93fb6cffc0663e9ff0e34 downloaded from Docker Hub.
- Docker version used: Docker version 18.06.1-ce, build e68fc7a
- Environment settings relevant to the config: Ubuntu 18.04.1 LTS
@Tecnativa TT25079
Context
Using the recommended volume configuration won't save your mail queue from restarts:
https://github.com/tomav/docker-mailserver/blob/f225e14a219824e4ebb34e63b144e6d7c1314bcb/docker-compose.yml.dist#L13-L17
What is affected by this bug?
Deferred mails in queue will not be resent after a reboot or container rebuild.
When does this occur?
When some mail gets deferred and queued and, later, you reconfigure your container (quite common for fixing some kind of problem, like a relay password that has changed), the mail queue is lost.
How do we replicate the issue?
Configure with
SMTP_ONLY=1and someDEFAULT_RELAY_HOSTthat makes the sent mails fail. The failure might be a wrong password or (in the case below) a wrong TLS setting.Send a mail.
Execute
postqueue -pin the container. You'll see an output similar to:Fix the problem.
Rebuild with
docker-compose up -d --force-recreateExecute
postqueue -pin the container.Actual Behavior
The new mail queue will be empty.
Running this command seems to explain why:
That's the directory where mail queue is stored, and it's not in any volume.
Expected behavior (i.e. solution)
The queue should be stored under
/var/mail-state/spool-postfix. Or/var/spool/postfixshould be a recommended mount point. Or maybe even/var/spool? Because this command shows that it's used also somewhere else:$ postconf -p | grep /spool queue_directory = /var/spool/postfix smtpd_sasl_path = /var/spool/postfix/private/authYour Environment
org.label-schema.vcs-reflabel is right, it points to f225e14. In any case, the exact image issha256:701355354a94a936006df1e7635eec5fff2cedf166c93fb6cffc0663e9ff0e34downloaded from Docker Hub.@Tecnativa TT25079