On 2011-06-09 11:46, Mark Martinec wrote:
Sandro,
I find a lot of spam that has already passed other spam-filters with
spamassassin better tuned than mine an already have a X-Spam-Flag to YES.
I tried to add a rule to match that case:
header CUSTOM_X_SPAM_FLAG X-Spam-Flag =~ /\bYES\b/i
score CUSTOM_X_SPAM_FLAG 5
But spamassassin -t< /tmp/spam does not show any hit ot that rule.
Moreover using flag -D I don't see it being called. I set it in
/etc/spamassassin/local.cf
Is it any possible to match on that rule?
It is an unfortunate consequence of a M::S::PerMsgStatus::check()
removing any 'x-spam-*' header fileds _before_ performing any checks.
It would probably make more sense to do so after checks but before
collecting a report or a rewritten message. I'm just not sure what
other code or rules depend on this, so fixing your case might
break something else (or may not, needs investigating).
You may open a problem report.
As a workaround, you may add some header rewrite rule to your MTA
which could rewrite a X-Spam-Flag to something else, like X-X-Spam-Flag.
or if you want to be rather radical, reject at MTA level with a header
check.
Motto: "Dear Sender: if you pre-tag your mail as spam, keeep it"