01/05/2011
Block Spam with russian encoding using spamassassin
Lately the amount of spam with russian encoding/charset that I was getting had increased significantly. Spamassassin’s configuration options “ok_locales” and “ok_languages” were not enough because I didn’t want to whitelist some language, but I just wanted to blacklist some.
So the solution for my problems was the addition of the following lines in the configuration of spamassassin:
header LOCAL_CHARSET_RUSSIAN Subject:raw =~/\=\?koi8-r\?/i score LOCAL_CHARSET_RUSSIAN 7 describe LOCAL_CHARSET_RUSSIAN Contains russian charset that is not acceptable
If you want to add even more charsets:
header LOCAL_CHARSET_BLOCKED Subject:raw =~/\=\?(koi8-r|windows-1251)\?/i score LOCAL_CHARSET_BLOCKED 5 describe LOCAL_CHARSET_BLOCKED Contains charsets that are not acceptable
Be VERY careful with these rules if you place them in the global config (/etc/spamassassin/local.cf) because if any of your users are getting emails in russian those emails will be probably marked as spam!!
Filed by kargig at 13:27 under Internet
Tags: charset, email, russian, spam, spamassassin
2 Comments | 13,621 views