[Mimedefang] action_add_header before SpamAssassin

Michael Faurot mfaurot at atww.org
Sat Mar 13 15:22:33 EST 2004


I'm doing some experiments with SPF by using Mail::SPF::Query
inside MIMEDefang.  I've run into a snag and I'm not sure if what I'm
trying to do is feasible/possible.  In particular, what I'm trying to do
is use action_add_header(), within filter_begin(), to add a Received-SPF
header before calling spam_assassin_check().

The actual call to action_add_header() seems to be working, because when
I inspect my test messages, I am seeing the expected Received-SPF header.
But it doesn't seem like SpamAssassin, via spam_assassin_check(), is
seeing the header I've added.  For example, this is one SPF rule I've
added to /etc/mail/spamassassin/sa-mimedefang.cf

	header SPF_NONE                 Received-SPF =~ /none/
	describe SPF_NONE               Received-SPF header says NONE
	score SPF_NONE                  -0.001

After I call spam_assassin_check() I call action_add_header() like this
to see what tests SA ran and how it scored things:

	action_add_header("X-SA-Status", "hits=$hits required=$req tests=$names");

So, when I look at the test messages I send, I don't see "SPF_NONE" as
one of the rules SA has scored on in the header X-SA-Status.  And yes, I
am sending my test messages from a site that has not published any
SPF information in the TXT record of their DNS zone.

So, am I just doing something wrong or is not possible to add a header in MD,
and then expect SA to score on it?

I realize it would be possible to make adjustments to $hits, after
calling spam_assassin_check() and then incrementing or decrementing as
appropriate based upon my SPF query.  However, I'd prefer to keep this
within SA so that any adjustments made based upon SPF get logged in SA's
report and are listed as tests run by SA.



More information about the MIMEDefang mailing list