TextCat

This plugin will try to guess the language used in the message body text. You can use the ok_languages directive to set which languages are considered okay for incoming mail and if the guessed language is not okay, UNWANTED_LANGUAGE_BODY is triggered. Alternatively, you can use the X-Languages metadata header directly in rules.

Note that the language cannot always be recognized with sufficient confidence. In that case, no action is taken.

How it works

Warden enables the Mail::SpamAssassin::Plugin::TextCat plugin in SpamAssassin, which builds a language guess from n-gram models of the message body text. ok_languages lists the languages that are considered okay for incoming mail, and the UNWANTED_LANGUAGE_BODY rule is triggered if none of the detected languages is in that list (this is the only effect of the list - it does not act as a welcomelist against any other form of spam scanning). inactive_languages controls which language models are considered when guessing, and textcat_max_languages limits how many languages a single message may match at the same time before its classification is treated as unknown.

The results are always stored as an X-Languages name-value pair in the message metadata, where they can be used as Bayes tokens or in rules for scoring. The _TEXTCATRESULTS_ tag exposes the internal n-gram scoring, which might help fine-tuning the settings.

Rules

Area Rule name Description Default scores
body UNWANTED_LANGUAGE_BODY Message written in an undesired language 2.800
body BODY_8BITS Body includes 8 consecutive 8-bit characters 1.500

Related Pages