Negative lookahead assertion rule in procmail

Say in procmail you want a rule that puts subjects like:

“Sale Alert: Howies”   (or anything other than Howies)

in your inbox but not

“Sale Alert: Banana Republic”

You can do this with a negative lookahead assertion like so:

:0:
* ^Subject: (You have sale alerts|Sale Alert):? *(?!Banana)
$DEFAULT

Leave a Reply

Your email address will not be published. Required fields are marked *