Dear Aki,
as far as I know, I'm not using chroot. I am not aware of any setting within my dovecot configuration that I attached which enables this. I checked my mysql database as well (as it is stated in the dovecot documentation that a chroot can also be returned by userdb), but it is not activated there as well.
Also, I am using Apparmor and it is logging blocks to kern.log, where I can't find anything related to this issue.
What I can notice is that this issue only happens randomly and once it happened, it will continue to happen until dovecot is restarted. Then only mails with attachments are stuck in mailqueue. I can't reproduce it, even if I want to. I just sent a mail with a 25 MB attachment to an address and it wasn't a problem. I can see from my logfiles though, that this issue has happened several times already.
Lars
Am 08.06.2017 um 10:09 schrieb Aki Tuomi:
On 07.06.2017 23:42, Lars-Sören Steck wrote:
Dear list,
I'm currently facing problems when receiving eMails with attachments, at least sometimes.
My mailserver is set up with the tool 'Mailcow', and hence is based on Dovecot (2.2.22 (fe789d2)) and Postfix.
Usually, there are no problems with receiving mails. If a mail has an attachment, however, it is possible that the following error occurs (extract from /var/log/mail.log):
'Jun 7 12:50:28 mail postfix/lmtp[26827]: 564E68A0515: to=<abc@def.ghj>, relay=my.mail.server[private/dovecot-lmtp], delay=0.71, delays=0.67/0.01/0.01/0.02, dsn=4.3.0, status=deferred (host my.mail.server[private/dovecot-lmtp] said: 451 4.3.0 Temporary internal failure (in reply to end of DATA command))'
Extract from /var/log/mail.err:
'Jun 7 12:50:28 mail dovecot: lmtp(26828): Error: Temp file creation to /tmp/dovecot.lmtp.mail.26828. failed: No such file or directory'
Once this happened the first time after dovecot is running, it will happen for all incoming mails with attachments. This can be solved temporarily by restarting the dovecot service and running postqueue -f, but that obviously does not solve the underlying problem.
In this post to this list, it is stated that dovecot sometimes creates temp files to avoid 'excessive memory usage'. I'm guessing that this is the case here, also the error message is similiar:
https://dovecot.org/list/dovecot/2016-June/104722.html
Should I simply change the configuration variable mail_temp_dir to solve this? Why is dovecot not able to find the /tmp folder? In the list thread, it is stated that this is caused by dovecot running with enabled chrooting. As far as I understand it though (correct me if I'm wrong), chrooting is not enabled in my dovecot configuration.
Please find attached the output of 'dovecot -n':
Are you using either chroot or some apparmor/selinux/whatever security suite which is preventing writing to /tmp?
Aki