I have a PMG server as an antispam/antivirus gateway.
Messages classified by PMG, when forwarded to Carbonio, are analyzed again by amavis/spamassassin, resulting in spam classification errors.
How can Carbonio consider the header X-Spam-Flag: YES coming from PMG and not passing spamassassin again?
Hi, I think SpamAssassin should always check all messages as a normal behavior but you can always add a SpamAssassin configuration rule (using header or header_eval rule types) to control it and not making more tests.
header X-Spam-Flag X-Custom-Header =~ /YES/
describe X-Spam-Flag Marked as spam at PMG level
score X-Spam-Flag 0.0
With this rule, SpamAssassin will check the specified header field for the specified value. If the condition is met, no spam score will be added to the message bypassing further spam checks for that message.
hope this gives you a clue
let us know if you make it work
Have a nice day
I will configure PMG to send a custom header to carbonio and test.
Thanks.
It worked.
I configured PMG to add the X-PMG-Flag header: YES
I created a file /opt/zextras/data/spamassassin/localrules/zzsauser.cf
header PMG_SPAM X-PMG-Flag =~ /YES/
describe PMG_SPAM PMG SPAM
score PMG_SPAM 5.0
bayes_ignore_header X-PMG-Flag
zmamavisdctl restart
Now messages marked as spam by PMG go directly to the user's spam folder.