procmail
[Top] [All Lists]

Re: Match X but not Y if is also there

2001-12-01 15:18:43
Justin wrote,

| * ? formail -x"Received:" | egrep -is "broadwing.net"

Eek.  No, EEK!  Two outside programs and a shell to connect them are a major
waste of cycles for something that procmail can do itself (and they do it
incorrectly, since the period in "broadwing.net" isn't escaped).

 * ^Received:.*broadwing\.net

That works (in the head, but not in the body) even if the Received: headerer
is continued with <newline><indentation> onto more than one line of text.

| Is there a way to match broadwing.net in the Received line but not if
| one also contains the strign netzero.net?

Well, yes.  Remember that multiple conditions on a recipe are ANDed, so it's
like this:

 * ^Received:.*broadwing\.net
 * !^Received:.*netzero\.net

No formails, no egreps, no pipes.



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