procmail
[Top] [All Lists]

Chinese-spam filter

2000-02-11 05:08:37
Please comment: 

--- 

FORMAIL="/usr/bin/formail"
# WSP contains a space and a tab:
WSP=[     ]
NWSP=[^     ]
CNSPAM     # unset CNSPAM

# (sorry, just couldn't resist)
:0 fh w
* ^TO()\/procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de
| $FORMAIL -i"Reply-To: $MATCH"


:0 
* $ ! ^Subject:$WSP*[spam]
{
  # block "Received: 202.90-109.*.*"
  :0
  * ^Received:$WSP*.*202\.(10|9)[0-9]\.[0-9]+\.[0-9]
  { CNSPAM=spam1 }

  :0 E
  {
    :0BD
    * -1^1 .
    *  2^1 =[0-9A-F][0-9A-F]
    * 20^1 [################################] #160-191 
    * 20^1 [################################] #192-223 
    * 20^1 [################################] #224-255 
    * 20^1 =[A-F][0-9A-F]
    { CNSPAM=spam2 }
  }

  :0         # if CNSPAM is set
  * CNSPAM ?? 
  {
    MATCH    # unset MATCH 
    :0       # if subject has a non-blank character, set MATCH
    * $ ^Subject:$WSP\/$NWSP.*
    {}
             # make Subject-header, even if there was none
    :0 fh w
    | $FORMAIL -A"Subject: [$CNSPAM] $MATCH"
  }
}

--- 
Thanks, Ruud 



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