Mike Brudenell
2007-Apr-26 09:17 UTC
[Dovecot] Deferring, instead of rejecting, messages when at quota
Greetings - I'm having trouble working out where to alter this behaviour (so please forgive me if it turns out to be an Exim thing rather than Dovecot!)... My test service is using Exim as the MTA and Dovecot's "deliver" for the LDA. We are using Maildir mailboxes with filestore quotas. When I send a large test message to myself that cannot be delivered because I don't have sufficient available quota remaining an error message is immediately returned to the sender and the incoming message discarded. The error message says this: Your message was automatically rejected by Dovecot Mail Delivery Agent. The following reason was given: Not enough disk space Instead of Exim rejecting the incoming message and generating the error response because of deliver's failure to, umm, deliver I'd like the message to be retained in Exim's queue so that it can be retried periodically. With our old/live system (Sendmail + UW IMAP's "tmail" LDA) I edited the tmail source code to return a different exit code: one that caused Sendmail to defer (re-queue) the message rather than reject it. How do I achieve this effect with Exim + deliver please? Is it a case of: * Setting something in Dovecot's configuration file (I can't spot what!); * Changing a return code in deliver's source (if so, whereabouts and to what?); * Or is there an Exim directive I need to add to the transport definition in its configuration file? With thanks, Mike B-) -- The Computing Service, University of York, Heslington, York Yo10 5DD, UK Tel:+44-1904-433811 FAX:+44-1904-433740 * Unsolicited commercial e-mail is NOT welcome at this e-mail address. *
Magnus Holmgren
2007-Apr-26 09:36 UTC
[Dovecot] Deferring, instead of rejecting, messages when at quota
On Thursday 26 April 2007 11:17, Mike Brudenell wrote:> When I send a large test message to myself that cannot be delivered > because I don't have sufficient available quota remaining an error > message is immediately returned to the sender and the incoming > message discarded. The error message says this: > > Your message was automatically rejected by Dovecot Mail Delivery > Agent. > > The following reason was given: > Not enough disk space > > Instead of Exim rejecting the incoming message and generating the > error response because of deliver's failure to, umm, deliver I'd like > the message to be retained in Exim's queue so that it can be retried > periodically. > > How do I achieve this effect with Exim + deliver please?In Exim, you can set the temp_errors option of the transport. I don't know what code is returned in this case, but I have temp_errors = 73:75:77:78:89. If Exim takes care of all the hard errors (like nonexisting user...) you can almost set temp_errors = *. -- Magnus Holmgren holmgren at lysator.liu.se (No Cc of list mail needed, thanks) "Exim is better at being younger, whereas sendmail is better for Scrabble (50 point bonus for clearing your rack)" -- Dave Evans -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available URL: <http://dovecot.org/pipermail/dovecot/attachments/20070426/2cdf3872/attachment.bin>
Mike Brudenell
2007-Apr-26 10:01 UTC
[Dovecot] Deferring, instead of rejecting, messages when at quota
Greetings - On 26 Apr 2007, at 10:36, Magnus Holmgren wrote:> In Exim, you can set the temp_errors option of the transport. I > don't know > what code is returned in this case, but I have temp_errors = > 73:75:77:78:89. > If Exim takes care of all the hard errors (like nonexisting > user...) you can > almost set temp_errors = *.Hmmm... I'm continuing to peer at the source code of Dovecot's deliver and related libraries and have a feeling it's not going to be as straight forward as the above. It looks as though deliver calls routines in lib-storage to try and write out the message. If these detect a problem they flag the error, and the routine they use to do so indicates it is not a temporary one. Deliver sees the write failed and, seeing that temporary_error is FALSE itself generates and sends the error response. I'm currently trying to work out how this behaviour can be changed without affecting other things. For example it probably isn't safe to change the function used by the storage routines to flag that any and every error logged through it is a temporary_error: there may well be other places it gets called where the error is NOT temporary. Likewise I'm not sure if I can simply change the source of deliver to always return a temporary failure code because again there may be other problems that occur which should be permanently failed. I think I need help from Timo on this one, unless someone has already worked this one out previously? Cheers, Mike B-) -- The Computing Service, University of York, Heslington, York Yo10 5DD, UK Tel:+44-1904-433811 FAX:+44-1904-433740 * Unsolicited commercial e-mail is NOT welcome at this e-mail address. *