procmail
[Top] [All Lists]

Re: Procmail und Quota

2007-02-19 06:38:01


    Normaly, the sender will get an error message to say:
...
----- Transcript of session follows -----
procmail: Quota exceeded while writing ...
Thats what I expected - but there is no action from procmail.
I have configured procmail now to check and send the mail itself,
but a "builtin solution" would be better.


my script (if you have maybe a better solution):

USER=`echo $DEFAULT | cut -d"/" -f3 | sed s/\\\./_/g`
QUOTA= `quota -u $USER | tail -n 1 | awk '{print \$3}'`
INBOXSIZE=`du -s /home/test.account/Maildir/ | awk '{print \$1}'`
DROPPRIVS=yes

:0
* $ -${INBOXSIZE}^0
* $ ${QUOTA}^0
{
    MAXMSG = $=
    MAXMSGK=`echo "$MAXMSG*1024" | bc`
    :0
    * > ${MAXMSGK}
    {
        REC=`formail -zx"To:"`
        LOG="Mail to big for account $REC"
        EXITCODE=0
        :0
        * ^X-Loop: bounce(_at_)postfix-howto(_dot_)de
        /dev/null
        :0
        | formail -rk -I"Subject: Mailsize to big for account $REC" \
         -A"FROM: $DAEMON" -A"Precedence: junk" \
         -A"X-Loop: bounce(_at_)postfix-howto(_dot_)de" | $SENDMAIL -t
     }
}
:0E
{
    :0 w
    {
        REC=`formail -zx"To:"`
        LOG="Mailsize exceeded for account $REC"
        EXITCODE=0
        :0
        * ^X-Loop: bounce(_at_)postfix-howto(_dot_)de
        /dev/null
        :0
        | formail -rk -I"Subject: Mailbox full for account $REC" \
         -A"FROM: $DAEMON" -A"Precedence: junk" \
         -A"X-Loop: bounce(_at_)postfix-howto(_dot_)de" | $SENDMAIL -t
    }
}


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>