[Dovecot] Dovecot deliver discards emails (mail loss)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hello,
Dovecot deliver used with filesystem quota, sendmail v8.13 via .forward-mechanism causes mail loess:
May 8 09:49:53 ux-2s11-9 deliver(dvtest): msgid=200705080749.l487nclf029596@ux-2s11-9.inf.fh-bonn-rhein-sieg.de: save failed to INBOX May 8 09:49:53 ux-2s11-9 deliver(dvtest): msgid=200705080749.l487nclf029596@ux-2s11-9.inf.fh-bonn-rhein-sieg.de: Return-Path missing, rejection reason: Not enough disk space May 8 09:49:53 ux-2s11-9 sendmail[29618]: l487nclf029596: to="| /etc/mail/runde", ctladdr=dvtest (31045/102), delay=00:00:15, xdelay=00:00:00, mailer=prog, pri=120033, dsn=2.0.0, stat=Sent
"/etc/mail/runde" is a shell script to capture various status of the delivery attempt, incl. a strace log.
Below are the last lines of the strace.
Actually, I expected deliver to _tempfail_ the delivery attempt with "out of quota". However, the mail is lost, I guess, because sendmail received a return code "0".
================== brk(0x8115000) = 0x8115000 time(NULL) = 1178610593 open("/var/cache/dovecot/31045/index/.INBOX/dovecot.index", O_RDWR|O_LARGEFILE) = 7 alarm(120) = 0 fcntl64(7, F_SETLKW64, {type=F_RDLCK, whence=SEEK_SET, start=0, len=0}, 0xbfaa8c44) = 0 alarm(0) = 120 fstat64(7, {st_mode=S_IFREG|0600, st_size=2144, ...}) = 0 mmap2(NULL, 2144, PROT_READ|PROT_WRITE, MAP_SHARED, 7, 0) = 0xb7ee6000 open("/var/cache/dovecot/31045/index/.INBOX/dovecot.index.log", O_RDWR|O_LARGEFILE) = 8 fstat64(8, {st_mode=S_IFREG|0600, st_size=2984, ...}) = 0 pread64(8, "\1\0\30\0\214\267\377E\1\0\0\0\0\0\0\0\0\0\0\0\214\267"..., 24, 0) = 24 fcntl64(7, F_SETLK64, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}, 0xbfaa8ca4) = 0 time(NULL) = 1178610593 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=837, ...}) = 0 stat64("/home/dvtest/MailDir/new", {st_mode=S_IFDIR|0700, st_size=12288, ...}) = 0 stat64("/home/dvtest/MailDir/cur", {st_mode=S_IFDIR|0700, st_size=4096, ...}) = 0 stat64("/home/dvtest/MailDir/tmp/1178610593.P29623Q0M537288.ux-2s11-9", 0xbfaa8d90) = -1 ENOENT (No such file or directory) umask(0) = 077 open("/home/dvtest/MailDir/tmp/1178610593.P29623Q0M537288.ux-2s11-9", O_WRONLY|O_CREAT|O_EXCL|O_LARGEFILE, 0600) = 9 umask(077) = 0 _llseek(9, 0, [0], SEEK_CUR) = 0 fstat64(9, {st_mode=S_IFREG|0600, st_size=0, ...}) = 0 writev(9, [{"From root@ux-2s11-9.inf.fh-bonn-"..., 70}, {"\n", 1}], 2) =
- -1 EDQUOT (Disk quota exceeded) utime("/home/dvtest/MailDir/tmp/1178610593.P29623Q0M537288.ux-2s11-9", [2007/05/08-09:49:53, 2007/05/08-09:49:53]) = 0 fsync(9) = 0 close(9) = 0 unlink("/home/dvtest/MailDir/tmp/1178610593.P29623Q0M537288.ux-2s11-9") = 0 time([1178610593]) = 1178610593 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=837, ...}) = 0 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=837, ...}) = 0 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=837, ...}) = 0 send(6, "<22>May 8 09:49:53 deliver(dvte"..., 130, MSG_NOSIGNAL) = 130 time([1178610593]) = 1178610593 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=837, ...}) = 0 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=837, ...}) = 0 stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=837, ...}) = 0 send(6, "<22>May 8 09:49:53 deliver(dvte"..., 170, MSG_NOSIGNAL) = 170 close(8) = 0 munmap(0xb7ee6000, 2144) = 0 close(7) = 0 munmap(0xb7d6c000, 39020) = 0 munmap(0xb7ee7000, 8952) = 0 munmap(0xb7d43000, 166416) = 0 fcntl64(3, F_GETFD) = 0x1 (flags FD_CLOEXEC) close(3) = 0 close(5) = 0 exit_group(0) = ?
=============== protocol lda { # Address to use when sending rejection mails. postmaster_address = postmaster@mail
# Support for dynamically loadable plugins. mail_plugins is a space separated # list of plugins to load. mail_plugin_dir = /usr/local/dovecot/lib/dovecot/lda mail_plugins = quota mail_log cmusieve
# Binary to use for sending mails. sendmail_path = /usr/sbin/sendmail
# UNIX socket path to master authentication server to find users. auth_socket_path = /var/run/dovecot/auth-master
# Log to syslog log_path = info_log_path = syslog_facility = mail }
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBRkAvCC9SORjhbDpvAQKXiwgAoWOhnRqlqqqcWrT0r/vPB4vklFUylxFz rgNlNklola01iqZWT3SXsraxGbbK4xnU4D2XtxoA8uwONZ3pQny+2gdnwlDlcjcY Uqme8Rmr4TQz3JiTgMlT2I2gUGeSNrgckDV3Q9VvFfUT+23kEIhOahL4aBVD9tsv SV3YZDkekP4qndrfxRfW5cVwsaaRX4YJZsk47mx2oakmaoFb3qGk3QGV0x9sZRhj AvXeIKu8SQkHMC6rbSJiwr34oYZl/aGA7Z/vB3iTxE3NgkyqE1WoUfxgdo1EiXTJ /i+E26VD/YJy6sWLy/usZibZMG/TJ3EM9kNmEk+23dLJbhX130Uk3A== =Md0l -----END PGP SIGNATURE-----
Steffen Kaiser wrote:
msgid=200705080749.l487nclf029596@ux-2s11-9.inf.fh-bonn-rhein-sieg.de: Return-Path missing, rejection reason: Not enough disk space May 8 09:49:53 ux-2s11-9 sendmail[29618]: l487nclf029596: to="| /etc/mail/runde", ctladdr=dvtest (31045/102), delay=00:00:15, xdelay=00:00:00, mailer=prog, pri=120033, dsn=2.0.0, stat=Sent
Was the return-path of that message indeed empty/missing as indicated? Can you show the entire log history for message id l487nclf029596? Of course, if there was no return-path, then no bounce would be generated.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 8 May 2007, Justin McAleer wrote:
Steffen Kaiser wrote:
msgid=200705080749.l487nclf029596@ux-2s11-9.inf.fh-bonn-rhein-sieg.de: Return-Path missing, rejection reason: Not enough disk space May 8 09:49:53 ux-2s11-9 sendmail[29618]: l487nclf029596: to="| /etc/mail/runde", ctladdr=dvtest (31045/102), delay=00:00:15, xdelay=00:00:00, mailer=prog, pri=120033, dsn=2.0.0, stat=Sent
Was the return-path of that message indeed empty/missing as indicated? Can you show the entire log history for message id l487nclf029596? Of course, if there was no return-path, then no bounce would be generated.
History of sendmail? Dunno, but here it is: May 8 09:49:45 ux-2s11-9 sendmail[29596]: l487nclf029596: from=root, size=33, class=0, nrcpts=1, msgid=<200705080749.l487nclf029596@ux-2s 11-9.inf.fh-bonn-rhein-sieg.de>, relay=root@localhost May 8 09:49:45 ux-2s11-9 sendmail[29596]: l487nclf029596: to="| /etc/mail/runde", delay=00:00:07, mailer=prog, pri=30033, stat=queued May 8 09:49:53 ux-2s11-9 deliver(dvtest): Loading modules from directory: /usr/local/dovecot/lib/dovecot/lda May 8 09:49:53 ux-2s11-9 deliver(dvtest): Module loaded: /usr/local/dovecot/lib/dovecot/lda/lib10_quota_plugin.so May 8 09:49:53 ux-2s11-9 deliver(dvtest): Module loaded: /usr/local/dovecot/lib/dovecot/lda/lib20_mail_log_plugin.so May 8 09:49:53 ux-2s11-9 deliver(dvtest): Module loaded: /usr/local/dovecot/lib/dovecot/lda/lib90_cmusieve_plugin.so May 8 09:49:53 ux-2s11-9 deliver(dvtest): maildir: data=/home/dvtest/MailDir:CONTROL=/var/cache/dovecot/31045/control:INDEX=/var/cache/do vecot/31045/index May 8 09:49:53 ux-2s11-9 deliver(dvtest): maildir: root=/home/dvtest/MailDir, index=/var/cache/dovecot/31045/index, control=/var/cache/do vecot/31045/control, inbox= May 8 09:49:53 ux-2s11-9 deliver(dvtest): fs quota add storage dir = /home/dvtest/MailDir May 8 09:49:53 ux-2s11-9 deliver(dvtest): fs quota block device = /dev/mapper/mailstud-mailstud May 8 09:49:53 ux-2s11-9 deliver(dvtest): fs quota mount point = /home May 8 09:49:53 ux-2s11-9 deliver(dvtest): msgid=200705080749.l487nclf029596@ux-2s11-9.inf.fh-bonn-rhein-sieg.de: save failed to INBOX May 8 09:49:53 ux-2s11-9 deliver(dvtest): msgid=200705080749.l487nclf029596@ux-2s11-9.inf.fh-bonn-rhein-sieg.de: Return-Path missing, rejection reason: Not enough disk space May 8 09:49:53 ux-2s11-9 sendmail[29618]: l487nclf029596: to="| /etc/mail/runde", ctladdr=dvtest (31045/102), delay=00:00:15, xdelay=00:0 0:00, mailer=prog, pri=120033, dsn=2.0.0, stat=Sent
=====================
Well, I have three problems with the situation:
a) sendmail will send bounces easily, when Deliver's exit code is != 0 and != Tempfail. Moreover, the sendmail log wouldn't claim that the mail had been delivered successfully in this case. You can return any message by printing to stdout or stderr.
b) "rejection reason: Not enough disk space" is not a permanent, but a temporary failure. error = mail_storage_get_last_error(storage, &syntax, &temporary_error); in src/deliver/deliver.c near line 700 should set temporary_error.
c) If Deliver cannot send the bounce - for whatever reason -, it had not saved the message either, hence, it must not simply ignore the fact, but at least should tempfail the mail. So I do interprete the "return smtp_client_close(smtp_client);" near line 121 of src/deliver/mail-sent.c as well for the case that the rejection is attempted.
You have been right, sendmail does not put Return-Path into the mail, but a From<SPACE> only, when using the .forward mechanism. When using Deliver as mailer, there is the Return-Path.
Bye,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBRkF1Ty9SORjhbDpvAQJoDQgA07vkOdiDHsROUEClnhLsGQDzX0HL+Y3l bpOFaCvb5BIJEoZEHkbXFEvau+qDAsxs47iC8X4cXaFoLsyUpH+vmM3Kb2wMEmyI +iuYCl8q1zEKEj/mWb+Z0a9BCr2KM5ECyX8hsake4czrzOx9y0QCUx6f5SiJHRkj mYfLi2N4J/Yrva2C9bXADfYo/5rSF5UKnVvIeqKMu0vOKC6AS/Ayea5t31edaJY9 Ew8PadroAgGKsBSZfElyDbUIkbKMAEnJ5cebzV4dVjK0tGva7ANo18FNou8UM5Cz UPmUZ6y7nG6fEAzYXV3r5Pi3A93U2YTWWgXyRjRuPra/0cZ9PZ83Qw== =2i7K -----END PGP SIGNATURE-----
participants (2)
-
Justin McAleer
-
Steffen Kaiser