Spamassasin filter foreign language emails

nisamudeen97

Well-Known Member
Jul 7, 2010
51
5
58
Cochin
cPanel Access Level
Root Administrator
Hi,

I would like to do global filtering of foreign language emails using Spamassasin. I would like to reject emails especially Chinese. I have gone through different docs regarding the same. Below are the ones which I have followed for testing. Meanwhile I could see non are helpful. Still I receive Chinese emails. I have tried to debug the case and found the below error in "/var/log/maillog". Look to have some expert advise on this.

lifewire.com/spamassassin-foreign-language-spam-1166250

weavweb.net/2015/10/11/cpanel-email-filtering-to-stop-chinese-or-non-english-character-spam/


config: failed to parse, now a plugin, skipping, in "/etc/mail/spamassassin/local.cf": ok_languages en de la th sv
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Hello,

Could you let us know the specific changes you made to the /etc/mail/spamassassin/local.cf file?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Hello,

You'd need to also enable the TextCat plugin referenced at:

ImproveAccuracy - Spamassassin Wiki

To do so, add the following line to the /etc/mail/spamassassin/init.pre file:

Code:
loadplugin Mail::SpamAssassin::Plugin::TextCat
Then, restart SpamAssassin via:

Code:
/scripts/restartsrv_spamd
Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Hello,

Feel free to open a support ticket using the link in my signature if you'd like us to take a closer look. You can post the ticket number here so we can update this thread with the outcome.

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,205
363
Hello,

To update, a symbolic link was created using the below commands to ensure the TextCat SpamAssassin plugin worked as expected:

Code:
cd /var/lib/spamassassin/3.004001/
ln -s updates_spamassassin_org/languages languages
Thank you.
 

keat63

Well-Known Member
Nov 20, 2014
1,854
226
93
cPanel Access Level
Root Administrator
I once wrote a filter rule to block chinese emails.
Take a look at all the chinese emails that your recieve and you'll start to spot a few common chinese characters.
I copied and pasted a few in to a global filter rule, they almost stopped over night.