1

I try to define a rule for the header field "X-Spam-Flag" in the incoming rule to check whether this e-mail already has been checked. I created a little test-email with the following headers:

X-SPAM-FLAG: YES
X-SPOM-FLAG: YES

The rules are:

header     ALLREADY X-SPAM-FLAG:raw =~ /YES/
describe   ALLREADY wurde schon mal markiert
score      ALLREADY 4

header     OLLREADY X-SPOM-FLAG:raw =~ /YES/
describe   OLLREADY wurde schon mal markiert
score      OLLREADY 4

and the result is:

 4.0 OLLREADY               wurde schon mal markiert

So my question: How do I get the rule ALLREADY working just like OLLREADY does?

NobsWare
  • 21
  • 6

1 Answers1

1

Someone on the SA-mailing list confirmed: It is not possible inside SA as all X-Spam fields are discarded.

So the solution is to fiddle with the Mailer. Here is my solution in Postfix:

If not already present, get the PCRE-package of postfix

apt-get install postfix-pcre

If not already present, add header-check support in postfix:

main.cf :
header_checks = pcre:/etc/postfix/header_checks.pcre

add the config line

header_checks.pcre:
/^X-Spam-Flag:\s+YES/ PREPEND x-already-spam: yes

reload postfix config

postfix reload

Now you have a header-field that will "survive" and can get checked by a rule in SA.

For testing you can add header fields in an email before sending in mutt with E .

NobsWare
  • 21
  • 6