Hi, we are using dovecot's deliver to deliver mails to a virtual mailbox tree owned by the vmail user, by piping the message to the following command spawned by vmail: /usr/bin/env HOME=/srv/vmail/mydomain.ch/myaccount /usr/lib/dovecot/deliver When a message is delivered to an account that has reached its quotum, deliver issues a failure message saying: From: Mail Delivery Subsystem <postmaster at seamus.madduck.net> To: $ENVELOPE_SENDER Message-ID: <dovecot-1221640816-796581-0 at seamus> Subject: Automatically rejected mail Your message to <vmail> was automatically rejected: Quota exceeded The original message is attached, which is nice, however, I don't like the dovecot rejection message for two reasons: 1. there was no message to <vmail> sent, dovecot should use the envelope recipient considering that it doesn't know the envelope recipient, this would best be solved by 2. don't accept the mail and send out a rejection, just exit 69 and write the reason to stderr! Did I miss something and is this already possible with dovecot's deliver in a virtual setting? Thanks, -- martin | http://madduck.net/ | http://two.sentenc.es/ "how do you feel about women's rights?" "i like either side of them." -- groucho marx spamtraps: madduck.bogus at madduck.net -------------- next part -------------- A non-text attachment was scrubbed... Name: digital_signature_gpg.asc Type: application/pgp-signature Size: 197 bytes Desc: Digital signature (see http://martin-krafft.net/gpg/) URL: <http://dovecot.org/pipermail/dovecot/attachments/20080917/d4917f43/attachment-0002.bin>
On Wed, Sep 17, 2008 at 09:55:16AM +0100, martin f krafft wrote:> When a message is delivered to an account that has reached its > quotum, deliver issues a failure message saying: > > [...] > > considering that it doesn't know the envelope recipient, this would > best be solved by > > 2. don't accept the mail and send out a rejection, just exit 69 and > write the reason to stderr! > > Did I miss something and is this already possible with dovecot's > deliver in a virtual setting?To exit with EX_TEMPFAIL instead of sending a rejection message, use deliver's -e flag and the following dovecot.conf snippet, taken straight from our mail server. protocol lda { # If user is over quota, return with temporary failure instead of # bouncing the mail. quota_full_tempfail = yes quota_exceeded_message = 4.2.2 Mailbox full } We only changed quota_exceeded_message because of Postfix' support of enhanced status codes, which gets you a nice bounce message with the right diagnostic code. This requires dovecot 1.0.1 or later, according to http://wiki.dovecot.org/LDA; additionally writing the rejection reason to stderr requires dovecot 1.1.1 or later.