Unwanted Language in the Message Body: Difference between revisions
(Created page with "=Add spam score if unwanted languages in the message body= <hr> {{KB|{{WIP}}|{{ZCS 8.8}}|{{ZCS 9.0}}}} <hr> __FORCETOC__ ====Problem==== Receiving spam mails with unwanted/u...") |
|||
Line 8: | Line 8: | ||
====Solution==== | ====Solution==== | ||
Mails contains with unwanted language(s) in the message body can be prevented by identifying the language and adding spam score to the respective message. | Mails contains with unwanted language(s) in the message body can be prevented by identifying the language and adding spam score to the respective message. SpamAssassin having built in module TextCat which helps to prevent this kind of emails. | ||
'''Step 1:''' | |||
* Load TextCat module from a custom file <code>/opt/zimbra/data/spamassassin/localrules/custom_plugins.pre</code> | |||
:<pre>echo -e "loadplugin Mail::SpamAssassin::Plugin::TextCat\n" > /opt/zimbra/data/spamassassin/localrules/custom_plugins.pre</pre> | |||
: '''Notes:''' | |||
: Run as zimbra user [<code>su - zimbra</code>] | |||
: Default file of TextCat module is <code>/opt/zimbra/data/spamassassin/localrules/v310.pre</code> | |||
Revision as of 11:47, 7 August 2022
Add spam score if unwanted languages in the message body
Problem
Receiving spam mails with unwanted/unknown language(s) in the message body.
Solution
Mails contains with unwanted language(s) in the message body can be prevented by identifying the language and adding spam score to the respective message. SpamAssassin having built in module TextCat which helps to prevent this kind of emails.
Step 1:
- Load TextCat module from a custom file
/opt/zimbra/data/spamassassin/localrules/custom_plugins.pre
echo -e "loadplugin Mail::SpamAssassin::Plugin::TextCat\n" > /opt/zimbra/data/spamassassin/localrules/custom_plugins.pre
- Notes:
- Run as zimbra user [
su - zimbra
] - Default file of TextCat module is
/opt/zimbra/data/spamassassin/localrules/v310.pre
Step 2:
Add below lines in the file "/opt/zimbra/conf/salocal.cf.in"
ok_languages <Language one short code>,<Language two short code>
Example:
ok_languages en>,es
Notes: ok_languages means spam assassin will accept emails in those languages and it will add spam score to all other languages. We can add ok_languages before the line "# accept email from zimbra support and forums" Add at least two languages as accepting languages.
Step 3:
Edit spam score for unwanted languages. Open "/opt/zimbra/data/spamassassin/rules/50_scores.cf" and edit "UNWANTED_LANGUAGE_BODY"
score UNWANTED_LANGUAGE_BODY <score>
Example: score UNWANTED_LANGUAGE_BODY 4.0
Reference: https://metacpan.org/pod/Mail::SpamAssassin::Plugin::TextCat