Spamassassin особые правила и прочие хитрости

Table 3-1. Message portions and associated test directives
| Message part | Directive | Possible tests |
|---|---|---|
| Headers | header TESTNAME | Match a regexpDon’t match a regexpExistsEvaluate Perl codeCheck Received headers against DNSBL |
| Message subject and text of message body, decoding all textual MIME parts, with HTML tags and line breaks removed | body TESTNAME | Match a regexpEvaluate Perl code |
| Text of message body, decoding all textual MIME parts, with HTML tags and line breaks retained | rawbody TESTNAME | Match a regexpEvaluate Perl code |
| Undecoded message body including all MIME parts | full TESTNAME | Match a regexpEvaluate Perl code |
| URIs in the message body | uri TESTNAME | Match a regexp |
| URIs in the message body | uridnsbl TESTNAME | (SpamAssassin 3.0) Check for address in a DNS-based blacklist |
op is either
=~ (contains regular expression)
!~ (does not contain regular expression)
cat /etc/spamassassin/local.cf
# Aizaro custom ruleset (begin at 25.02.16)
# Доверяем домену rusem.ru и ставим отрицательный score
header FROM_REM From =~ /rusem.ru/i
score FROM_REM -1.0
describe FROM_REM Email from rusem.ru
# Отсекаем все письма с темой "коллекция"
header SUBJ_COLLECT Subject =~/коллекция/i
score SUBJ_COLLECT 5.0
describe SUBJ_COLLECT Video collection
Проверка правил spamassassin:
Полезные ссылки:
1. Таблица скоринга со штатным правилами
2. Правила написания и тестирования собственных правил
3. Автоматизация создания правил с помощью Devel:DProf
4. Загрузка Spamassassin
5. FAQ
6. Профессия – убивать спам
7. Пользовательские наборы правил
8. Спам через postfix
9. Лучшая статья на английском по синтаксису custom rules sa
10. Documetations for Spamassassin config
11. Борьба со спамом