[Mimedefang] SpamAssassin via mimedefang is slow

Daniel Bourque dbourque at weatherdata.com
Fri Nov 7 09:43:41 EST 2008


Humm, well I replaced spam_assassin_check() with my own sa_check() and 
now it's smoking fast, it matches the speed I get from running it manually.

Nov  6 16:37:21 mail2 mimedefang.pl[10666]: ----- calling sa_check ----
Nov  6 16:37:22 mail2 mimedefang.pl[10666]: ----- finished sa_check ----

<2 sec processing time.

All tests are performed and get the same report, score, etc... Not sure 
what's going on with spam_assassin_check, it's doing a lot more elaborate


sub sa_check()
{

    my $message;

    open(IN, "./INPUTMSG") or return 0;
    while ( <IN> ) {
            @message = <IN>;
        }
    close(IN);

    my $spamtest = Mail::SpamAssassin->new({
            userprefs_filename => "/etc/mail/sa-mimedefang.cf"});

    my $mail = $spamtest->parse(\@message,0);

    my $status = $spamtest->check($mail);

    my $hits = $status->get_hits;
    my $req = $status->get_required_hits();
    my $names = $status->get_names_of_tests_hit();
    my $report = $status->get_report();

    return($hits, $req, $names, $report);

}

hope that helps out someone else who as the same issue.


-- 
Dan




More information about the MIMEDefang mailing list