On Tue, Jul 22, 2003 at 12:16:53PM +0200, Dallman Ross wrote:
On Tue, Jul 01, 2003 at 06:17:28PM -0500, Jeffrey Parker wrote:
INBOXSIZE=`ls -l ${ORGMAIL} 2>/dev/null | awk '{print $5}'`
Why not just
INBOXSIZE = `wc -c < $ORGMAIL 2>/dev/null`
I think it's debatable whether you generate more load by parsing the
directory listing through a two-part pipe versus shovelling the entire
mailbox into a smaller pipe. Of the two solutions, I'd go for the
directory entry, so that a 20MB mailbox didn't generate 20MB of data
being read from the disk every time a message comes in.
As I've mentioned before, my solution to this was to write a small C
program which is lighter-weight than either of these approached. It's
at http://www.it.ca/software/fsizecompare.c for your viewing pleasure.
You could implement it like this:
QUOTA=15000000
MSG="User's quota exceeded. You should also see a bounce message."
:0
* !$? fsizecompare $QUOTA $ORGMAIL
{ EXITCODE=77 }
:0 A
* ^Subject: \/.+
| ( formail -rI"BOUNCED: $MATCH" ; echo "$MSG" ) | $SENDMAIL -t -oi
Adjust $MSG to suit.
--
Paul Chvostek
<paul(_at_)it(_dot_)ca>
Operations / Abuse / Whatever
it.canada, hosting and development http://www.it.ca/
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail