[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.
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
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
On Fri, 2008-05-02 at 13:35 +0200, Ulrich Zehl wrote:
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".
Committed a slightly different version: http://hg.dovecot.org/dovecot-1.1/rev/40929ce03622
participants (4)
-
Johannes Berg
-
Timo Sirainen
-
Ulrich Zehl
-
Ulrich Zehl