[Mimedefang] MIMEDefang 2.3 Beta 5

Nels Lindquist nlindq at maei.ca
Fri Jan 18 13:07:33 EST 2002


On 17 Jan 2002 at 16:45, Jeff Heinen wrote:

> -----Original Message-----
> From: Nels Lindquist [mailto:nlindq at maei.ca]
> Sent: Thursday, January 17, 2002 4:11 PM
> 
> On to SpamAssassin.  After fixing the SA bug on my production server, 
> the only problems I've run into were caused by messages with large 
> attachments (say, several MB or more) which results in a tempfail for 
> those messages.  I noticed in the documentation for spamd that by 
> default it doesn't process messages which exceed 250KB in size. (Such 
> messages are exceedingly unlikely to be spam anyway.)  
> 
> I've set up a check for this in my mimedefang-filter file, but 
> perhaps it would be better handled within the spam_assassin* 
> functions themselves?  I'll code up some proposed changes if anyone 
> thinks this might be generally useful.
> 
> ---
> 
> I'd like to see that, I'd think letting overly large messages slide might
> help quite a few people. However, I would rather see it stay in the
> mimedefang-filter file. For me, it would be easier to skip the over block of
> SA checking/header rewriting code, instead of having to check the output of
> whichever SA procedure you call. It also makes it more visible for later
> postmasters, they would see in the filter which messages are being ignored
> and can adjust it there if the mail servers are moved to better boxes.

If you set it up properly, one wouldn't need to do much in the way of
handling the return values.  As for visibility, you could set up the
spam_assassin procedures to accept an optional numeric parameter.  If
a value is passed, then deal with the size issue, otherwise run as 
normal.
A call like 
  ($hits, $req, $names, $report) = spam_assassin_check(250 * 1024)
would be fairly obvious, right?

Here's what I'm doing right now in mimedefang_filter:

sub size_of_msg {
    my @filestats;
    @filestats = stat("./INPUTMSG");
    return $filestats[7];
}

sub filter_begin {
    $msgsize = size_of_msg();
    if ($msgsize <= 256000) {
        ($SA_Hits, $SA_Required, $SA_Tests, $report) = \
          spam_assassin_check();
    } else {
        $SA_Hits=0;
        $SA_Required=5;
        $SA_Tests="MAX_MSG_SIZE_EXCEEDED";
    }

    if ($SA_Hits && ($SA_Hits >= $SA_Required)) {
        $SpamFound = 1;
    }
}

sub filter_end {
    if ($SpamFound) {
        return action_add_header("X-Spam-Status",
           "Yes, hits=$SA_Hits required=$SA_Required 
tests=$SA_Tests");
    } else {
        return action_add_header("X-Spam-Status",
           "No, hits=$SA_Hits required=$SA_Required 
tests=$SA_Tests");
    }
}
----
Nels Lindquist <*>
Information Systems Manager
Morningstar Air Express Inc.




More information about the MIMEDefang mailing list