procmail
[Top] [All Lists]

Re: Mailbox limit

2001-08-04 07:39:29
On  4 Aug, George Chelidze wrote:
| here is the final version of procmail's recipe, which limits the mailbox
| size to 1Kb. Thank all of you who helped me with it. Any more comments
| will be appreciated.
| 
| MAXSIZE=1024
| BOXSIZE=`[ -f $DEFAULT ] && ls -l $DEFAULT | while read a b c d e f; do
| echo $e; done || echo 0`
| 
| :0
| * $ $MAXSIZE^0
| * $ -$BOXSIZE^0
| {
|     :0
|     * > $=
|     {
|          :0
|          * ! ^Subject.*mail delivery
|          | (formail -r -I"From: postmaster(_at_)geo(_dot_)net(_dot_)ge" \
|                               -I"Subject: mail delivery" \
|                               -I"Return-Path: 
postmaster(_at_)geo(_dot_)net(_dot_)ge"; \
|                               echo "Mailbox full") | $SENDMAIL -t
|          :0 E
|          /dev/null
|     }
| }
| 

This looks better in terms of the efficiency of using procmail's
scoring to do the size comparison[1], but I still think it suffers from
the other two deficiencies. And those deficiencies are functional.
First, 1024 is even smaller than the original 10240 I think you started
with. For example your message that I'm replying to is 5116 bytes in my
mailbox. So if I had that limit on my mbox and got two messages like
yours, the second would be plonked.  It's your call, but that seems
pretty limiting.

If that tight a limit is what you intend, then the second problem is
even odder. All you're testing is the size of the mbox before the new
message is delivered. If it's under the limit the message is accepted.
So you could be enforcing a 1024 byte limit on the mbox and accept a
message of unlimited size just because it wasn't over quota before
delivery. I dunno, but that doesn't make sense to me. I would think you
would want to test the sum of the size of the existing mbox + the size
of the incoming message, to make sure the sum of the two isn't over the
quota. But maybe that's just me.

[1] David Tamkins suggestion to use wc -c <$DEFAULT for assigning to
BOXSIZE would also be a definite improvement.

-- 
                   /"\
Don Hammond        \ /     ASCII Ribbon Campaign
Raleigh, NC US      X        Against HTML Mail,
                   / \      and News Too

_______________________________________________
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>