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

One Comment

  1. Hello,

    thanks for this rule. Unfortunately for me it is not working on Ubuntu 18.04 with procmail 3.22
    Which Version of procmail you use and which OS? For me ethering works but no negative lookahead.

    Thanks,
    Hajo

Leave a Reply

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