I have found a lot of examples for procmail to match on the From: header with wilcards, but I'd like to do an exact match, in order to prevent From:.*jgordon@example.com matching both jgordon@example.com and bjgordon@example.com
Is this possible, and if so, how?
Best Answer
The customary procedure is to add word boundary anchors on both sides of the target address.
If you want to match exactly two email addresses and no others, craft a regular expression which will only match those two. In your specific example,
b?jgordon@example\.com
will match bothbjgordon
andjgordon
. A common similar pattern is to want to match bothfirstname.lastname
andflastnam
; a pattern for that would be(firstname\.lastname|flastnam)@example\.com
.