Re: add_header all RelaysUntrusted _RELAYSUNTRUSTED_

Paul Murphy <[email protected]>
Newsgroups gmane.mail.mimedefang
Message-ID <[email protected]>
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,

Paul.

-----Original Message-----
From: MIMEDefang [mailto:[email protected]] On Behalf Of Marcus Schopen
Sent: Thursday, December 15, 2016 12:24 AM
To: [email protected]
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.

Ciao
Marcus


_______________________________________________
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 [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

_______________________________________________
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 [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.