Hi, everybody, for the first time in my career as a network administrator,
I've decided to play a little with procmail.
I've installed disk quotas over the /var partition of the hdd, and I want
procmail not to deliver the messages if some user is over his/her quota, but
also to warn the sender so no further messages will arrive to this address
untill the user clean his/her mailbox.
Searching in the procmail lists, I've found the following recipe, or some
sort of it, because the original one didn't work at all, so I've had to
break my head to make it do something at all.
#space check
#checks for necessary disk space:
MAXSIZE=20971520 #maximum mailbox size in bytes = 20Mb
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:
| (/usr/bin/formail -r -I"From: postmaster(_at_)quimica(_dot_)unlp(_dot_)edu(_dot_)ar"
-I"Subject:
Mensaje no entregado. La casilla de ${LOGNAME}(_at_)quimica(_dot_)unlp(_dot_)edu(_dot_)ar esta
llena"
) | $SENDMAIL -t
:0 E
/dev/null
}
The main problem with this recipe is that the incoming mail that triggered
the quota warning is requeued, not discarded or bounced back to the sender.
Does anyone know how to check the quota, and, in case that some user is
overquota, bounce back the mail to the sender? Is it possible to do?
I'm using porcmail 3.22 from source, sendmail 8.12.8, imap-2001a-15, over
RedHat 7.2 with XFS filesystem.
Thanks,
Luis
"He choosed to live the eternity, but one day at the time"
Frank Herbert
_________________________________________________________________
Charla con tus amigos en línea mediante MSN Messenger:
http://messenger.yupimsn.com/
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail