Ulrich Zehl
2008-Apr-30 15:45 UTC
[Dovecot] deliver: handling of quota_full_tempfail and -e
Hi, while testing out dovecot 1.1, I found that when you set quota_full_tempfail = yes in dovecot.conf and use the deliver -e command line flag, no deferral reason is printed, thus breaking my fancy quota_exceeded_message. This appears to be because of the if() block in lines 1003-1009 in src/deliver/deliver.c, and should be easily fixable (if it is indeed a bug, and not intended behavior). However, I shied away from creating a patch because either there is a mismatch between the documentation and deliver's actual behavior, or I misunderstood the code (likely, since I'm not really a C programmer). The lines in question (in src/deliver/deliver.c) read: | 1003 if (error != MAIL_ERROR_NOSPACE || | 1004 getenv("QUOTA_FULL_TEMPFAIL") != NULL) { Does this mean that the corresponding block gets executed whenever quota_full_tempfail is set? If so, setting it transforms all errors into TEMPFAILs, and not only those relating to quota/space issues. I think dovecot-example.conf should at least mention this it's inteded; otherwise, the code should be changed (I'm not completely sure what Timo's intensions are, so I won't comment on possible solutions). Regards, Ulrich PS: All line numbers are taken from rev 080dd4d2fd94, which was the most recent at the time of writing.
Johannes Berg
2008-Apr-30 15:53 UTC
[Dovecot] deliver: handling of quota_full_tempfail and -e
> The lines in question (in src/deliver/deliver.c) read: > | 1003 if (error != MAIL_ERROR_NOSPACE || > | 1004 getenv("QUOTA_FULL_TEMPFAIL") != NULL) { > > Does this mean that the corresponding block gets executed whenever > quota_full_tempfail is set?No, the corresponding code is executed whenever the error is not "out of space" or, when the error *is* NOSPACE, return tempfail when quota is full. Hence, what happens is that any error other than "out of space" gives TEMPFAIL and when quota-full-tempfail is set "out of space" also gives tempfail. johannes -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 828 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20080430/caf655b1/attachment-0002.bin>
Ulrich Zehl
2008-May-02 11:35 UTC
[Dovecot] [PATCH] Re: deliver: handling of quota_full_tempfail and -e
On Wed, Apr 30, 2008 at 05:53:37PM +0200, Johannes Berg wrote:> > > The lines in question (in src/deliver/deliver.c) read: > > | 1003 if (error != MAIL_ERROR_NOSPACE || > > | 1004 getenv("QUOTA_FULL_TEMPFAIL") != NULL) { > [...] > > Hence, what happens is that any error other than "out of space" gives > TEMPFAIL and when quota-full-tempfail is set "out of space" also gives > tempfail.You're right, of course; thanks for clearing it up. I missed that the other day: While the code is always executed if quota_full_tempfail is set, this doesn't matter if there was any other error than "out of space", as a TEMPFAIL is intended in this case anyway. Now that the intial confusion is cleared up, I'd like to propose the following patch which changes deliver's -e flag behavior to also include the error message when TEMPFAILing. This is useful in setups like mine where deliver is called from some MTA (e.g., Postix) that includes the command response in bounces generated for mails that have been in the queue for too long. Without the patch, the sender will not get a meaningful error message back other than "temporary error". Ulrich -------------- next part -------------- --- deliver.c.orig 2008-05-02 13:30:37.000000000 +0200 +++ deliver.c 2008-05-02 12:35:36.000000000 +0200 @@ -1005,6 +1005,10 @@ /* Saving to INBOX should always work unless we're over quota. If it didn't, it's probably a configuration problem. */ + + if (stderr_rejection) + fprintf(stderr, "%s\n", error_string); + return EX_TEMPFAIL; }
Apparently Analagous Threads
- PATCH: sendmail-like DSNs in Dovecot deliver (EX_TEMPFAIL always)
- Dovecot discards mail over quota
- Defer email via LMTP when there is 'no space left on device' instead of rejecting it
- quota_full_tempfail = yes broken with lmtp_rcpt_check_quota (was: Re: lmtp_rcpt_check_quota not working)
- per-mailbox message limits