in reply to 'rifle' - POP3 Mailbox SPAM/UCE Filter

Don't you just hate those SPAM/UCE messages which have your actual email address buried amongst a bunch of similar addresses, in the 'To' or 'Cc'? Normally, you'd keep any message which contains your address in the 'To' or 'Cc'.

I made a filter by collecting some of these other addresses. I don't know any of these people, so there is no chance I'll ever want any email that is 'Cc'-ed to them. This has proven to be highly effective against such SPAM/UCE. It also demonstrates the kind of flexibility this 'rifle' program gives you in specifiying your filters.

{ hdr => [ 'To', 'Cc' ], regex => 'gerard\@('.join('|', map(quotemeta, qw( memes.com midusa.net mis.net misterat.com mkb.hobby.nl mlecmn.net mninter.net mobilnet.net monad.net moncourrier.com mood.freeserve.co.uk moransopticians.healthnet.co.uk mozcom.com mrnet.com msi.campus-ventures.co.uk msn.com ))). ')', op => 'toss', desc => 'SPAM/UCE with many gerards in To/Cc list' },

Replies are listed 'Best First'.
Re: Additional filtering suggestion.
by perldoc (Scribe) on Jan 26, 2002 at 01:30 UTC

    Actually, there is a much simpler way to do this, and it does not require maintaining a list of other people's email addresses.

    Match on the domains you do want, then negate the result. Like so:

    { hdr => [ 'To', 'Cc' ], regex => 'gerard\@(?!('. join('|', map( quotemeta, qw(mycompany.com oldname.com homedomain.com))). +'))', op => 'toss' },

    This will throw out mails addressed to 'gerard' which are not from the specified domains.