[Mimedefang] rewrite_mail in SA.
Matthew Schumacher
matt.s at aptalaska.net
Thu Nov 19 14:46:38 EST 2009
List,
I need to get some info that spamassassin returns when calling check()
so I omit the normal mimedefang spam_assassin_check() and call
spam_assassin_status() directly:
#my($hits, $req, $names, $report) = spam_assassin_check();
my $status = spam_assassin_status();
my $hits = $status->get_score();
my $req = $status->get_required_hits();
my $names = $status->get_names_of_tests_hit();
my $report = $status->get_report();
my $rewritten_mail = $status->rewrite_mail();
# do stuff
$status->finish();
Everything works fine except for rewrite_mail(). When that is called I
get this in the logs:
mimedefang-multiplexor[2482]: Slave 1 stderr: Use of uninitialized value
in split at
/usr/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/PerMsgStatus.pm line 825.
mimedefang-multiplexor[2482]: Slave 1 stderr: Use of uninitialized value
in pattern match (m//) at
/usr/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/PerMsgStatus.pm line 832.
mimedefang-multiplexor[2482]: Slave 1 stderr: Use of uninitialized value
in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/PerMsgStatus.pm line 907.
mimedefang-multiplexor[2482]: Slave 1 stderr: Use of uninitialized value
in string ne at
/usr/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/PerMsgStatus.pm line 638.
mimedefang-multiplexor[2482]: Slave 1 stderr: Use of uninitialized value
in substitution iterator at
/usr/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/PerMsgStatus.pm line 639.
last message repeated 5 times
mimedefang-multiplexor[2482]: Slave 1 stderr: Use of uninitialized value
in concatenation (.) or string at
/usr/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/PerMsgStatus.pm line 910.
Funny thing is though, $rewritten_mail now has the message header in it.
Ultimately what I want to do is get at some spam assassin headers and
pass them though like this:
action_change_header("X-Spam-Relay-Country", $status->get(
"X-Spam-Relay-Country" ) );
Does anyone know why rewrite_mail() acts like this? Shouldn't it
rewrite the entire message and allow me to fetch SA headers with
$status->get()?
Thanks,
schu
More information about the MIMEDefang
mailing list