procmail
[Top] [All Lists]

Re: Mailbox limit

2001-08-03 09:13:31
On  3 Aug, George Chelidze wrote:
| Thank you for your answer. I am afraid I dont understand the following lines
| in your recipe. can you please explain them or lem me know where I can read
| some docs on them
| 
| > :0
| > * $ $MAXSIZE^0
| > * $ -$BOXSIZE^0
| 
| >   :0
| >   * $ > $=
| >   { your action for failure, because mbox would be full after delivery }
| 

Sure. The first is a scoring recipe (man procmailsc). Very basically
each condition is assigned a score if matched and if the total of all
scored conditions is > 0, then the sum of the conditions is considered
a match. Procmail saves the total score in the variable $=, which is
used in the second recipe to test the size of the incoming message. It
breaks down like this.

Add $MAXSIXE to the score:

* $ $MAXSIZE^0

Subtract $BOXSIZE from the score:

* $ -$BOXSIZE^0

In each of these "conditions" there is no condition, so the values of
the variables are simply added to the score for every message. 

So, if BOXSIZE < MAXSIZE the first recipe is a match and it continues on
to the recipes in the first level of braces. (If not, then the spool
file is already over the limit, so you know the message won't be
accepted without further testing.)

Then, test that the incoming message will not put mbox over MAXSIZE:

* > $=

[Note: I removed the leading '$' as originally posted because it's
unnecessary.]

The total score from the first recipe, contained in $=, represents the
difference between MAXSIZE and BOXSIZE, or the space remaining in the
spool file without going over quota. The ">" (man procmailrc) tests that
the current message is larger than this size by comparing it to $=. If
the message is greater than $=, then delivering it would put the mbox
over quota amd you can put your reject action in the braces.

Just so there's no confusion. In both of the places where I wrote:

{ your action for failure, because ... }

you need to put your code for rejecting the mail. Also, I seem to
recall some discussions that ">" tests the body and not the headers, but
may be wrong. If so, the worst that'll happen is a spool file could go
over quota by the size of the headers of the last message, but that
seems marginal compared to the size of the mbox. And it's still better
than accepting the last message regardless of size if the box is not yet
over quota.

Hope that helps and is ok, because I'm off to play golf and won't be
here to pick up the pieces. But then, picking up the broken pieces
after me is usually left to others anyway. ;-)

-- 
                   /"\
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>