procmail
[Top] [All Lists]

Re: procmail as sendmail filter

2000-02-06 09:33:04
"Brian Dawson" <b-dawson(_at_)tronicplanet(_dot_)de> writes:

Yes, filtering by the size of the message isn't the problem. The problem is
that I would like to filter this on our mail relay, before it is relayed.
Since our relay doesn't relay any mail locally, I need to have procmail
called from a ruleset and checked from there. As it stands right now,
procmail is never called because the mail is never going to the LDC.

Wait a few months, then upgrade to sendmail version 8.10.0 which includes
a new variable 'msg_size' and a new map class 'arith'.  With these you
should be able to do it all in sendmail, thus saving at least two execs
and several forks.  You can get the beta now, but I wouldn't install it
on a production server.


the unix command "wc -l", assign the exit result to a variable.

There is a brief example in the procmail mainpage that says a little about
this, but not really enough that I could fully digest it's meaning.

If you want the message size in procmail, just use the builtin scoring
capabilities:

        :0
        * 1^1 > 1
        { }
        SIZE = $=

If you want the size of just the body, then qualify the condition:

        :0
        * B ?? 1^1 > 1
        { }
        SIZE = $=

Philip Guenther

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