[Mimedefang] SpamAssassin via mimedefang is slow

Jonas Eckerman jonas_lists at frukt.org
Fri Nov 7 10:42:06 EST 2008

Daniel Bourque wrote:

> 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

Are you sure that the tests performed are the same?
Have you checked wether or not network tests are really the same 
for both ways of calling SA? Network tests can take some time, 
expecially if you don't have a local caching DNS proxy/server.

>    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);

If you're running MIMEDefang in your border MTA you should 
prepend a Received-header to the message before having SA parse 
it. Otherwise SA will not know wich relay you got the message from.

It's possible that the difference in speed is because you are now 
running with netrwork tests disabled though, wich would make the 
importance of correct path information less than it'd otherwise be.

I'd also suggest prepending a Return-Path header.

Jonas Eckerman, FSDB & Fruktträdet

More information about the MIMEDefang mailing list