procmail
[Top] [All Lists]

Re: multiple recipients

2004-02-24 17:47:54
At 17:52 2004-02-24 -0500, Robert Krueger wrote:
On Tue, 2004-02-24 at 17:34, Robert Krueger wrote:
> Hi,
>   Ruud gave me this suggestion to eliminate multiple recipients, which
> I've put in my .procmailrc, but it doesn't seem to work:
>
> LIMIT = 2   # Number of multiple recepients per email
> MATCH
> :0 :
> *  ^To:\/.*
> *  1^1  MATCH ?? @
> *  ^Cc:\/.*
> *  1^1  MATCH ?? @
> *  $ -$LIMIT^0
> red-spam
>
> I think it was put in correctly. ( exactly as above)

<snip>
Well, I see I missed one line:
SMALL = .000001

I haven't a clue what that does, but I'll stick it in there.

Nor do I since you don't mention WHERE it goes, but also because it isn't a condition line, or referred to within the recipe itself (if it is just one line, and not some braces and stuff, it isn't part of the recipe).

There's no need to undefine MATCH - for one, if ^To: doesn't match, you're not going to reach the scored condition which follows it.

There is however a glaring failure - the recipe expects BOTH the To: and Cc: headers to be present. If the Cc: header isn't present (as in the case of the spam that got through), then the recipe is going to fail, no matter how many addresses happened to be in the To: field.

Using VERBOSE logging would have made this pretty clear -- you should get in the habit of checking recipes in a sandbox, or taking a recipe, putting it into a sandbox, and throwing a saved message at it so you can re-evaluate the hows and whys.

Break the recipe down into component parts:

# Number of multiple recepients per email
LIMIT=2

:0:
* ^To:\/.*
* 1^1  MATCH ?? @
{
        RECIPS=$=
}

:0
* ^Cc:\/.*
* 1^1  MATCH ?? @
* $ $RECIPS^0
{
        RECIPS=$=
}

:0:
* $ -$LIMIT^0
* $ $RECIPS^0
red-spam


---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


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