Postfix Behavior When Mailbox Quota Reached

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Postfix Behavior When Mailbox Quota Reached

Carlwill
I just recently set a quota limit on my users Linux home directory for
2GB and my users are all using Maildir style in the Postfix config. My
questions is how does Postfix handle email delivery if it is unable to
deliver messages to /home/$user/Maildir/? to the system quota being
exceeded.

Does Postfix refuse to deliver the message or does it throw it in a
defer queue and continue to attempt delivery?

--
Man your battle stations...
Reply | Threaded
Open this post in threaded view
|

Re: Postfix Behavior When Mailbox Quota Reached

Victor Duchovni
On Wed, Jun 11, 2008 at 10:21:53PM -0400, Carlos Williams wrote:

> I just recently set a quota limit on my users Linux home directory for
> 2GB and my users are all using Maildir style in the Postfix config. My
> questions is how does Postfix handle email delivery if it is unable to
> deliver messages to /home/$user/Maildir/? to the system quota being
> exceeded.
>
> Does Postfix refuse to deliver the message or does it throw it in a
> defer queue and continue to attempt delivery?


    /* mbox_dsn - map errno value to mailbox-related DSN detail */

    const char *mbox_dsn(int err, const char *def_dsn)
    {
    #define TRY_AGAIN_ERROR(e) \
            (e == EAGAIN || e == ESTALE)
    #define SYSTEM_FULL_ERROR(e) \
            (e == ENOSPC)
    #define MBOX_FULL_ERROR(e) \
            (e == EDQUOT || e == EFBIG)

        return (TRY_AGAIN_ERROR(err) ? "4.2.0" :
                SYSTEM_FULL_ERROR(err) ? "4.3.0" :
                MBOX_FULL_ERROR(err) ? "5.2.2" :
                def_dsn);
    }

If write(2) returns with errno == EDQUOT or EFBIG, the message bounces
with a 5.2.2 DSN code. If the file-system itself is out of space, the
the message is deferred (4.3.0 DSN). Transient write errors are retried
with 4.2.0 DSNs and other errors (def_dsn from caller) are typically
bounced as 5.3.0 write errors.


--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

Re: Postfix Behavior When Mailbox Quota Reached

Sahil Tandon
In reply to this post by Carlwill
Carlos Williams <[hidden email]> wrote:

> I just recently set a quota limit on my users Linux home directory for
> 2GB and my users are all using Maildir style in the Postfix config. My
> questions is how does Postfix handle email delivery if it is unable to
> deliver messages to /home/$user/Maildir/? to the system quota being
> exceeded.
>
> Does Postfix refuse to deliver the message or does it throw it in a
> defer queue and continue to attempt delivery?

Viktor explains this in another reply.  But be careful; if your system
generates bounces because of your quota configuration, it may be construed as
backscatter.

--
Sahil Tandon <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Postfix Behavior When Mailbox Quota Reached

Carlwill
In reply to this post by Victor Duchovni
On Wed, Jun 11, 2008 at 10:39 PM, Victor Duchovni
<[hidden email]> wrote:

>
>    /* mbox_dsn - map errno value to mailbox-related DSN detail */
>
>    const char *mbox_dsn(int err, const char *def_dsn)
>    {
>    #define TRY_AGAIN_ERROR(e) \
>            (e == EAGAIN || e == ESTALE)
>    #define SYSTEM_FULL_ERROR(e) \
>            (e == ENOSPC)
>    #define MBOX_FULL_ERROR(e) \
>            (e == EDQUOT || e == EFBIG)
>
>        return (TRY_AGAIN_ERROR(err) ? "4.2.0" :
>                SYSTEM_FULL_ERROR(err) ? "4.3.0" :
>                MBOX_FULL_ERROR(err) ? "5.2.2" :
>                def_dsn);
>    }
>
> If write(2) returns with errno == EDQUOT or EFBIG, the message bounces
> with a 5.2.2 DSN code. If the file-system itself is out of space, the
> the message is deferred (4.3.0 DSN). Transient write errors are retried
> with 4.2.0 DSNs and other errors (def_dsn from caller) are typically
> bounced as 5.3.0 write errors.

Thanks for the reply but I don't understand what this means. Perhaps I
am neive but what exactly does your reply indicate? You appear to have
posted some kind of config file or output format which I can't make
out or relate to my question. Sorry to sound stupid.
Reply | Threaded
Open this post in threaded view
|

Re: Postfix Behavior When Mailbox Quota Reached

Victor Duchovni
On Wed, Jun 11, 2008 at 11:29:26PM -0400, Carlos Williams wrote:

> >
> >    /* mbox_dsn - map errno value to mailbox-related DSN detail */
> >
> >    const char *mbox_dsn(int err, const char *def_dsn)
> >    {
> >    #define TRY_AGAIN_ERROR(e) \
> >            (e == EAGAIN || e == ESTALE)
> >    #define SYSTEM_FULL_ERROR(e) \
> >            (e == ENOSPC)
> >    #define MBOX_FULL_ERROR(e) \
> >            (e == EDQUOT || e == EFBIG)
> >
> >        return (TRY_AGAIN_ERROR(err) ? "4.2.0" :
> >                SYSTEM_FULL_ERROR(err) ? "4.3.0" :
> >                MBOX_FULL_ERROR(err) ? "5.2.2" :
> >                def_dsn);
> >    }
> >
> > If write(2) returns with errno == EDQUOT or EFBIG, the message bounces
> > with a 5.2.2 DSN code. If the file-system itself is out of space, the
> > the message is deferred (4.3.0 DSN). Transient write errors are retried
> > with 4.2.0 DSNs and other errors (def_dsn from caller) are typically
> > bounced as 5.3.0 write errors.
>
> Thanks for the reply but I don't understand what this means. Perhaps I
> am neive but what exactly does your reply indicate? You appear to have
> posted some kind of config file or output format which I can't make
> out or relate to my question. Sorry to sound stupid.

I guess the days of Unix system administrators as a rule also being
C programmers are long gone. Over-quota deliveries trigger a bounce.
File-system full (not any given user's fault) failures are deferred
and retried.

--
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[hidden email]?body=unsubscribe%20postfix-users>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
Reply | Threaded
Open this post in threaded view
|

[OT] C Knowledge (was Postfix Behavior When Mailbox Quota Reached)

Pau Amma
On Thu, 12 Jun 2008, Victor Duchovni wrote:

> I guess the days of Unix system administrators as a rule also being
> C programmers are long gone. Over-quota deliveries trigger a bounce.
> File-system full (not any given user's fault) failures are deferred
> and retried.

I can still read C well enough to extract the relevant info from the
excerpt you quoted, and I think I could still write something if I had to,
but it's been years since I last wrote in any language except perl. (Not
taking offense, just a datapoint.)
Reply | Threaded
Open this post in threaded view
|

Re: Postfix Behavior When Mailbox Quota Reached

Egoitz Aurrekoetxea Aurre
In reply to this post by Victor Duchovni
Victor Duchovni wrote:
On Wed, Jun 11, 2008 at 11:29:26PM -0400, Carlos Williams wrote:

  
   /* mbox_dsn - map errno value to mailbox-related DSN detail */

   const char *mbox_dsn(int err, const char *def_dsn)
   {
   #define TRY_AGAIN_ERROR(e) \
           (e == EAGAIN || e == ESTALE)
   #define SYSTEM_FULL_ERROR(e) \
           (e == ENOSPC)
   #define MBOX_FULL_ERROR(e) \
           (e == EDQUOT || e == EFBIG)

       return (TRY_AGAIN_ERROR(err) ? "4.2.0" :
               SYSTEM_FULL_ERROR(err) ? "4.3.0" :
               MBOX_FULL_ERROR(err) ? "5.2.2" :
               def_dsn);
   }

If write(2) returns with errno == EDQUOT or EFBIG, the message bounces
with a 5.2.2 DSN code. If the file-system itself is out of space, the
the message is deferred (4.3.0 DSN). Transient write errors are retried
with 4.2.0 DSNs and other errors (def_dsn from caller) are typically
bounced as 5.3.0 write errors.
      
Thanks for the reply but I don't understand what this means. Perhaps I
am neive but what exactly does your reply indicate? You appear to have
posted some kind of config file or output format which I can't make
out or relate to my question. Sorry to sound stupid.
    

I guess the days of Unix system administrators as a rule also being
C programmers are long gone. Over-quota deliveries trigger a bounce.
File-system full (not any given user's fault) failures are deferred
and retried.

  
Basically if you want to enforce quotas I think one good method is to use maildrop or some maildir++ maildirsize "writter", and use reject at smtp time for overquota mailboxes, such as you can get with postfix-qreject :-)      (http://open.nht-norwick.com/postfix-qreject.html), or you could use too Anderson Nadal project VDA.. take a look at them...