[Rspamd-Users] Block emails with Chinese and Cyrillic characters in the subject
Andreas Günther
rspamd at linuxmaker.com
Wed Apr 22 06:40:01 UTC 2026
Am Mittwoch, 6. August 2025, 16:08:19 Mitteleuropäische Sommerzeit schrieb Steve
Witten:
> Here are the relevant regexps in
> $LOCAL_CONFDIR/local.d/maps.d/blacklist/content.map:
>
> # Non-Western charsets
> #
> /(=\?|charset\=)big5/i # Big5
> /(=\?|charset\=)euc-kr/i # Extended Unix Code -- Korean
>
> /(=\?|charset\=)windows-1251/i # Windows 1251
> /(=\?|charset\=)koi8-r/i # Cyrillic
> /(=\?|charset\=)gb2312/i # Chinese
> /(=\?|charset\=)ks_c_5601-1987/i # Hangul (Korean)
These are outdated rules. They're barely effective anymore because they recognize
outdated language-specific character sets like windows-1251, gb2312, or big5, while
modern spam emails almost always use universal UTF-8.
That's why my solution is this:
/etc/rspamd/local.d/multimap.conf
MIXED_NONLATIN_SUBJECT {
type = "header";
header = "Subject";
map = "${LOCAL_CONFDIR}/local.d/maps.d/mixed_nonlatin.map";
symbol = "MIXED_NONLATIN_SUBJECT";
description = "Cyrillic, Chinese, Arabic or other non-Latin subject";
regexp = true;
score = 6.0;
action = "reject";
}
and in
/etc/rspamd/local.d/maps.d/mixed_nonlatin.map
/\p{Cyrillic}/u
/\p{Han}/u
/\p{Arabic}/u
/\p{Hangul}/u
/\p{Hiragana}/u
/\p{Katakana}/u
Best regards
Andreas
More information about the Users
mailing list