Page 1 of 1

Redirect spam tagged message

Posted: Tue Dec 03, 2019 6:50 am
by Ghosto
I’m trying to redirect the message after passing the spam filter.

There is a rule on SpamAssassin, if the letter contains a certain word, a tag with the name of my rule is hung on it.

/opt/zimbra/data/spamassassin/localrules/myrule.cf

body ADM_RULE_1 /mymessagetag/
score ADM_RULE_1 8

Email content:

X-Spam-Flag: YES
X-Spam-Score: 7.401
X-Spam-Level: *******
X-Spam-Status: Yes, score=7.401 required=4 tests=[ADM_RULE_1=8, ALL_TRUSTED=-1, BAYES_20=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, KAM_NUMSUBJECT=0.5]
(spam filter works correctly)

Then I tried to redirect that email to another address using postfix_header_checks, but something go wrong.
I check postfix header checks with that rule. And its worked.

/opt/zimbra/conf/custom_header_checks

/^From:(.*)mygmail@gmail.com/ REDIRECT test2@mydomain.ru

But when I tried catch my custom tag ADM_RULE_1 is not worked.

/^X-Spam-Status:(.*)ADM_RULE_1/ REDIRECT test@mydomain.ru



Maybe someone know, how can I redirect email, that already passed spam filters ?