[Mimedefang] accessing SA template tags from MD

Sven Willenberger sven at dmv.com
Wed Aug 24 10:45:10 EDT 2005


On Mon, 2005-08-22 at 16:58 -0400, Sven Willenberger wrote:
> I realize that when used via MD, spamassassin cannot change email (add
> headers, etc); I was wondering, however, if some of the SA template tags
> can be accessed from within MD so as to create a new header using MD and
> plugging in the SA tag values, for example _DCCR_ and _DCCB_ which are
> the DCC results and "brand" respectively.


Ok, I have figured out how to access the tags now. I edited
mimedefang.pl as follows:

@6086 : my($hits, $req, $tests, $report, $dccresult) =
spam_assassin_check(@_);

@6114 : my $dccresult = $status->get_tag('DCCR'); # in the
spam_assassin_check subroutine

@6118 : return ($hits, $req, $tests, $report, $dccresult);

Then in mimedefang-filter:
my($hits, $req, $names, $report, $dccresult) = spam_assassin_check(); #
in filter_end subroutine

Then I could use dccresult to create a new header.

So, now that I was able to access this, is there any way to achieve the
above without a) directly modifying mimedefang.pl and b) creating a
function grab a PerMsgStatus from SA that would require passing the
entire message a second time to SA. I was thinking perhaps a
filter_unknown_cmd type function -- but this still leaves me with a
question of how to invoke SA without duplicating all the SA parts in
mimedefang.pl Ideas?

Sven




More information about the MIMEDefang mailing list