[Mimedefang] add_header all RelaysUntrusted _RELAYSUNTRUSTED_

Paul Murphy pjm at ousekjarr.org
Thu Dec 15 05:59:23 EST 2016

You call SpamAssassin like this in your filter:

	($hits, $threshold, $names, $report) = spam_assassin_check();

The "names" variable lists all of the rules in SA which were triggered, so you can apply some logic based on this:

if  ( $names =~ /RELAYSUNTRUSTED/ ) {
   # add header to message

If instead you want to get at the value that SA would have put into the header, you'll need to either parse the headers and compute this for yourself, or find a way to get SA to return that information to you in a different way.  One approach might be to scan the matching rule names, and if that rule was triggered, re-run SA directly on the INPUTMSG file, capture the output, and then grep out the header which SA added.

Best Wishes,


-----Original Message-----
From: MIMEDefang [mailto:mimedefang-bounces at lists.roaringpenguin.com] On Behalf Of Marcus Schopen
Sent: Thursday, December 15, 2016 12:24 AM
To: mimedefang at lists.roaringpenguin.com
Subject: Re: [Mimedefang] add_header all RelaysUntrusted _RELAYSUNTRUSTED_

Yes, I use action_change_header and action_delete_header to set X-Spam headers in mimedefang-filter. What I don't understand is how the get the value from SA's _RELAYSUNTRUSTED_ inside mimedefang-filter to put it to action_add_header function.


NOTE: If there is a disclaimer or other legal boilerplate in the above message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com MIMEDefang mailing list MIMEDefang at lists.roaringpenguin.com

More information about the MIMEDefang mailing list