1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Discuss in my forum

How to Filter Foreign Language Spam with SpamAssassin

By

Not everything I don't understand is spam. Most of the things don't understand are not. But when the majority of the email in a language I can read is junk, the spam percentage is even higher for mail using charsets that make my computer pause (and, obviously, look for them in hidden corners of the disk).

By default, SpamAssassin treats all languages equally. But you can configure it to parse each message and determine the language used. If it is not one of the "allowed" languages, SpamAssassin automatically adds a few points the message's spam score. If SpamAssassin is not sure about the language used, no points are assigned.

Filter Foreign Language Spam with SpamAssassin

To have SpamAssassin filter out mail in foreign tongues:

  • Open /etc/mail/spamassassin/local.cf in your favorite editor.
  • If not present, add "ok_languages " on a line of itself.
  • List the languages (from the list below) you want to accept, separated by spaces:
    • af - Afrikaans
    • sq - Albanian
    • am - Amharic
    • ar - Arabic
    • hy - Armenian
    • eu - Basque
    • bs - Bosnian
    • bg - Bulgarian
    • be - Belorussian
    • ca - Catalan
    • zh - Chinese
    • hr - Croatian
    • cs - Czech
    • da - Danish
    • nl - Dutch
    • en - English
    • eo - Esperanto
    • et - Estonian
    • fi - Finnish
    • fr - French
    • fy - Frisian
    • ka - Georgian
    • de - German
    • el - Greek
    • he - Hebrew
    • hu - Hungarian
    • hi - Hindi
    • is - Icelandic
    • id - Indonesian
    • ga - Irish Gaelic
    • it - Italian
    • ja - Japanese
    • ko - Korean
    • la - Latin
    • lv - Latvian
    • lt - Lithuanian
    • ms - Malay
    • mr - Marathi
    • ne - Nepali
    • no - Norwegian
    • fa - Persian
    • pl - Polish
    • pt - Portuguese
    • qu - Quechua
    • rm - Rhaeto-Romance
    • ro - Romanian
    • ru - Russian
    • sa - Sanskrit
    • sco - Scots
    • gd - Scottish Gaelic
    • sr - Serbian
    • sk - Slovak
    • sl - Slovenian
    • es - Spanish
    • sw - Swahili
    • sv - Swedish
    • tl - Tagalog
    • ta - Tamil
    • th - Thai
    • tr - Turkish
    • uk - Ukrainian
    • vi - Vietnamese
    • cy - Welsh
    • yi - Yiddish

To accept mail in English, German, Latin, Thai and Swedish, for example, use "ok_languages en de la th sv".

©2014 About.com. All rights reserved.