procmail
[Top] [All Lists]

Re: Checking if there is only one recipient

2002-10-01 11:23:39
Kreemy wrote,

| I'd like to check incoming messages to see if there is more than one
| recipient (in the To: and Cc:, obviously I can't know if there's a
| Bcc:) but I'm not sure where to start
|
| * ^To:[ ][^(_at_)]*<*kremels(_at_)kreme(_dot_)com>*$
| * ! ^Cc:.*@
|
| will this work if the To: is
|
| To: bob(_at_)isp1(_dot_)com, kremels(_at_)kreme(_dot_)com

No, because you're not allowing for an @ between "To:" and "kremels:";
besides, if you fixed that, it still requires your address to be the last one
on the To: line, so it would catch your example but not work for the general
case.

My own is something more like this:

RESENT
:0
* ^Resent-
{ RESENT=Resent- }

:0: # brackets on line 4 enclose caret, space, tab
* $ 2174783647^0 ^(Apparently-)?$RESENT(To|Cc:).*[.;]
* -1^0
* $ 1^1 ^(Apparently-)?$RESENT(To|Cc:).*[^     ]
multiples

Yes, it can be fooled by a quoted comma or semicolon in the formal name of a
recipient, but I've had no trouble living with the occasional false positive.
Instead of .*[,;] you could use (_dot_)*(_at_)(_dot_)*@, which in turn can be 
fooled by a
quoted at-sign in the formal name of a recipient or by an unqualified local
address.  Pick your poison.



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