procmail
[Top] [All Lists]

Mailbox limit

2001-08-03 06:11:28
Hello,
I have posted several messages about mailbox limit. I was pointed to use
procmail for this. I am new to procmail but managed to write the
following recipe for it.

MAXSIZE=10240 #maximum mailbox size in bytes = 10Mb
BOXSIZE=`ls -l /var/spool/mail/${LOGNAME} 2>/dev/null | while read a b c
d e f; do echo $e; done`
FULL=`expr ${BOXSIZE} \> ${MAXSIZE}`

:0
* $FULL ?? 1
{
    :0
    * ! ^Subject.*Mail Delivery Failure
    | (formail -r -I"From: postmaster(_at_)geo(_dot_)net(_dot_)ge" \
                         -I"Subject: Mail Delivery Failure" \
                         echo "Sorry message undelivered. reason:
mailbox full") | $SENDMAIL -t
    :0 E
    /dev/null
}

I have tested it and its seem to work fine. But I am not sure there are
no errors in it. It would be great if someone check this code. Any
comments and considerations will be appreciated. Thank you in advance

George

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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