[Dovecot] rejecting mail due to quota exceeded

Ulrich Zehl ulrich-dovecot at topfen.net
Wed Sep 17 12:31:32 EEST 2008


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.


More information about the dovecot mailing list