Hi,
I've been out of the loop for a while and I was wondering if any signficant changes have happened since 2.61 and whether I would likely be introducing any incompatibility issues by upgrading.
Currently I'm programatically invoke Spamassassin from within a perlscript that processes my incoming email and I use Mail::Audit to filter mail in Maildir style mailboxes and explicitly learn mail and either ham or spam.
use Mail::Audit qw(List KillDups); use Mail::SpamAssassin; use Mail::SpamAssassin::NoMailAudit; use Mail::SpamAssassin::PerMsgStatus;
my $spamtest = new Mail::SpamAssassin({ PREFIX => $PREFIX, DEF_RULES_DIR => $DEF_RULES_DIR, LOCAL_RULES_DIR => $LOCAL_RULES_DIR, });
my $mail = Mail::Audit->new( nomime=> 1, emergency=>"$maildir/.emergency/", loglevel=>2, log=>$log );
Because I'm using Mail::Audit I often have to construct NoMailAudit's from SA and visa versa.
sub noma_from_string_or_arrayref {
my $arrayRef = (ref $_[0] eq 'ARRAY') ? $_[0] : [ split /^/m, $_[0] ];
my $no_audit = Mail::SpamAssassin::NoMailAudit->new ('data' => $arrayRef);
return $no_audit;
}
sub ma_from_string_or_arrayref { my $arrayRef = (ref $_[0] eq 'ARRAY') ? $_[0] : [ split /^/m, $_[0] ]; my $mail_audit = Mail::Audit->new( nomime=> 1, emergency=>"$maildir/.emergency/", loglevel=>2, log=>$log, data=>$arrayRef); return $mail_audit; }
my @matched_lines = fetch_message_from_imap($msgid,$spam); my $learnmail = noma_from_string_or_arrayref([EMAIL PROTECTED]); log_text($mail, " Learning previously learnt spam as ham\n\n"); my $learn_status = $spamtest->learn($learnmail, undef, 0, 0);