On Wed, 2023-01-11 at 16:56 -0800, Loren Wilton wrote: > Why not do a simple rule rather than inventing some Perl code? > > header TO_SPECIFIC_EMAIL To:addr ~= > '(?:\bus...@example.com|\bus...@example.com|\bus...@example.com)' > describe TO_SPECIFIC_EMAIL Mail to a specific email address > score TO_SPECIFIC_EMAIL -2 > > header TO_SPECIFIC_DOMAIN To:addr '(?:'\@example1\.com | > \@example2\.com | \@example3\.com)' > describe TO_SPECIFIC_DOMAIN Mail to specific email domain > score TO_SPECIFIC_DOMAIN -2 > > or possibly > > header TO_SPECIFIC_DOMAIN To:addr '\@(?:example1\.com | example2\.com > | example3\.com)$' > > Agreed, though after a while the regex can get rather long and unwieldy, but its easy enough to keep the address list as a simple text file (one address per line) and write a simple program to create a syntactically correct SA rule from the list. That is easily done with Perl or (better) an awk script.
Martin