Lars-Sören Steck
2017-Jun-07 20:42 UTC
lmtp: Error: Temp file creation to /tmp/ ... failed: No such file or directory on incoming mails with attachments
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 at 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': # 2.2.22 (fe789d2): /etc/dovecot/dovecot.conf # Pigeonhole version 0.4.13 (7b14904) # OS: Linux 4.4.0-78-generic x86_64 Ubuntu 16.04.2 LTS auth_mechanisms = plain login dict { sqlquota = mysql:/etc/dovecot/dovecot-dict-sql.conf } listen = * log_timestamp = "%Y-%m-%d %H:%M:%S " login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c %k mail_home = /var/vmail/%d/%n mail_location = maildir:~/ mail_max_userip_connections = 500 mail_plugins = quota acl fts fts_solr managesieve_notify_capability = mailto managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii-numeric relational regex imap4flags copy include variables body enotify environment mailbox date index ihave duplicate mime foreverypart extracttext namespace { list = yes location = maildir:%%h/:INDEXPVT=~/Shared/%%u prefix = Shared/%%u/ separator = / subscriptions = no type = shared } namespace inbox { inbox = yes location mailbox Archiv { special_use = \Archive } mailbox Archive { auto = subscribe special_use = \Archive } mailbox Archives { special_use = \Archive } mailbox "Deleted Messages" { special_use = \Trash } mailbox Drafts { auto = subscribe special_use = \Drafts } mailbox Entw?rfe { special_use = \Drafts } mailbox "Gel?schte Objekte" { special_use = \Trash } mailbox Gesendet { special_use = \Sent } mailbox "Gesendete Objekte" { special_use = \Sent } mailbox Junk { auto = subscribe special_use = \Junk } mailbox Papierkorb { special_use = \Trash } mailbox Sent { auto = subscribe special_use = \Sent } mailbox "Sent Messages" { special_use = \Sent } mailbox Trash { auto = subscribe special_use = \Trash } prefix separator = / } passdb { args = /etc/dovecot/dovecot-mysql.conf driver = sql } plugin { acl = vfile acl_anyone = allow acl_shared_dict = file:/var/vmail/shared-mailboxes.db fts = solr fts_autoindex = yes fts_solr = url=http://127.0.0.1:8983/solr/ quota = dict:Userquota::proxy::sqlquota quota_rule2 = Trash:storage=+100%% sieve = /var/vmail/sieve/%u.sieve sieve_after = /var/vmail/sieve/global.sieve sieve_max_script_size = 1M sieve_quota_max_scripts = 0 sieve_quota_max_storage = 0 } protocols = imap sieve lmtp pop3 service auth { unix_listener /var/spool/postfix/private/auth_dovecot { group = postfix mode = 0660 user = postfix } unix_listener auth-master { mode = 0600 user = vmail } unix_listener auth-userdb { mode = 0600 user = vmail } user = root } service dict { unix_listener dict { group = vmail mode = 0660 user = vmail } } service lmtp { unix_listener /var/spool/postfix/private/dovecot-lmtp { group = postfix mode = 0600 user = postfix } user = vmail } service managesieve-login { inet_listener sieve { port = 4190 } process_min_avail = 2 service_count = 1 vsz_limit = 128 M } service managesieve { process_limit = 256 } ssl_cert = </etc/ssl/mail/mail.crt ssl_cipher_list EDH+CAMELLIA:EDH+aRSA:EECDH+aRSA+AESGCM:EECDH+aRSA+SHA384:EECDH+aRSA+SHA256:EECDH:+CAMELLIA256:+AES256:+CAMELLIA128:+AES128:+SSLv3:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!DSS:!RC4:!SEED:!ECDSA:CAMELLIA256-SHA:AES256-SHA:CAMELLIA128-SHA:AES128-SHA ssl_dh_parameters_length = 2048 ssl_key = </etc/ssl/mail/mail.key ssl_protocols = !SSLv3 !SSLv2 userdb { args = /etc/dovecot/dovecot-mysql.conf driver = sql } protocol imap { mail_plugins = quota imap_quota imap_acl acl fts fts_solr } protocol lmtp { auth_socket_path = /var/run/dovecot/auth-master mail_plugins = quota sieve acl fts fts_solr postmaster_address = postmaster at steck.cc } protocol sieve { managesieve_logout_format = bytes=%i/%o } remote 127.0.0.1 { disable_plaintext_auth = no } Thank you for your help. Lars
Aki Tuomi
2017-Jun-08 08:09 UTC
lmtp: Error: Temp file creation to /tmp/ ... failed: No such file or directory on incoming mails with attachments
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 at 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
Lars-Sören Steck
2017-Jun-09 00:05 UTC
lmtp: Error: Temp file creation to /tmp/ ... failed: No such file or directory on incoming mails with attachments
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 at 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
Maybe Matching Threads
- lmtp: Error: Temp file creation to /tmp/ ... failed: No such file or directory on incoming mails with attachments
- dovecot 2.3.7.2-1~bionic: Performance issues caused by excessive IO to ~/mdbox/mailboxes/INBOX/dbox-Mails/dovecot.index.tmp
- Plugin 'sieve_imapsieve' not found
- stats module
- stats module