procmail
[Top] [All Lists]

Re: Letting Fall Through Spam Catcher

1998-06-08 15:39:23
Paul Bartlett has this code,

| # This recipe should probably remain at the bottom of the spam catchers.
| # OR'ed conditions (use De Morgan's Law, taking inverses of "reals").
| # (This may also catch mail sent to me via Bcc:.)
| :0
| * $ ^TO$MY_ADDRX
| * ! ^Subject:.*(\<[\$]+|free|cash|money|rich|opportunity|AOL4Free\.com\>)

You don't need to escape a dollar sign inside brackets.

| * ! ^Precedence: *junk
| * ! ^Precedence: *bulk

You can combine those last two as

  * ! ^Precedence: *(bul|jun)k

| * ! ^Received: *from.*\.earthlink\.net
| * ! ^From:.*(@cyber|\
|              @quantcom\.com|\
|              @hotmail\.com|\
|              @juno\.com)
| { }
| :0E:
| $SPAMFOLDER

|     It is possible that I could receive some legitimate mail forwarded
| from another site which therefore would not be addressed explicitly to
| $MY_ADDRX and therefore would be caught by this recipe.  Instead I want
| it to fall through so that it would take the default processing route.
| In other words, the recipe above should NOT catch mail addressed to
| 
|         To: pobart(_at_)some(_dot_)other(_dot_)domain
| 
| which gets forwarded to my account where procmail is active.  Maybe my
| brain is just not in gear, but so far I have not figured out how to
| modify the recipe to pass mail forwarded from @some.other.domain.  Any
| suggestions will be gratefully accepted.

Two suggestions:

1.  Instead of definining $MY_ADDRX to match only $USER(_at_)$\HOST, define it 
as

    MY_ADDRX=pobart@(([^ ]+\.)*digex\.net|some\.other\.domain)

or

2.  Add a condition to the `else' recipe so that mail to your other address
    won't match that part either:

    :0E:
    * ! ^TO_pobart(_at_)some\(_dot_)other\(_dot_)domain
    $SPAMFOLDER

The results will be rather different: the first method will give a pass to
mail visibly addressed to your other account only if it has none of the
other signs of spammishness; the second way will keep any mail addressed to
your other account, whether it otherwise smells of spam or not, out of
$SPAMFOLDER.

<Prev in Thread] Current Thread [Next in Thread>