Using procmail, I want to move any incoming mail that does not contain my name ("John Doe") in the "To" field to the "Junk" folder.
However, the following rule does not seem to have any effect, even though I have tested the regular expression thoroughly in online testing apps to ensure it matches what it should:
# Filter spam if the name "John Doe" is not in "To"
:0:
* ^(?!To:.*John\sDoe).*
.Junk/
In case it is of interest, my entire procmail rule file is:
# Filter mail using SpamAssassin
:0fw: spamassassin.lock
* < 256000
| /usr/bin/spamassassin
# Filter spam based on "Spam-Level"
:0:
* ^X-Spam-Level: \*\*
.Junk/
# Filter spam if the name "John Doe" is not in "To"
:0:
* ^(?!To:.*John\sDoe).*
.Junk/
Why doesn't my rule work?
Thank you for any assistance!