procmail
[Top] [All Lists]

Re: multiple recipients

2004-02-24 19:41:53
Sean, Rudd,Dallman
You guys will probably whack me for this, but I've never heard or read
in any of my procmail stuff about putting something "in a sandbox".
I assume it's a test of some kind that gives the result of the process
without actually executing the command. ( A sort of "dry run" )
I'll look in my book and Nancy's article, if I can't find it I'll give
'ya'll a ring ;-)

On Tue, 2004-02-24 at 19:39, Professional Software Engineering wrote:
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).

Sorry,

LIMIT = 2   # Number of multiple recepients per email
SMALL = .000001
MATCH
....

:0 :

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


I was doing so much goofing around with this and Postfix yesterday, I
accidently ran mailstat as root on procmail.log, which created a new
procmail.log file with root's permissions, so consequently, I received
all my mail, VERBOSE was set to YES, but procmail.log was empty.  
Geeeezzz... 

Thanks Sean.
Sorry for the misquote, Dallman.
Thanks, Rudd

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