[Mimedefang] accept, then scan?

Jan-Pieter Cornet johnpc at xs4all.nl
Fri Sep 21 02:31:43 EDT 2007

On Thu, Sep 20, 2007 at 10:20:56PM -0700, Andy Lyttle wrote:
> As I understood it, once we've accepted HELO, RCPT FROM, MAIL TO and  
> gotten to the DATA part, we're committed to delivering the message  
> and cannot change our minds and reject it after we get to look at the  
> headers or body.

No, you can still reject the message after the DATA part. That's what
action_bounce in mimedefang is for.

However, you can only reject the entire message. If it was sent to
multiple recipients, it is rejected for all recipients, or accepted
for all recipients.

> However, it looks like connecting MTAs are waiting  
> for an acknowledgment that the message has been successfully received  
> after they've delivered the message contents, so maybe that isn't  
> entirely true?  Anyway, if it is true, what I'd like to do is to  
> accept the message, close the connection, and THEN scan the message  
> with SpamAssassin.  Is that possible?  The reason is, on old slow  

Simplest fix: take SpamAssassin out of mimedefang, run spamd, and
call spamc from .procmailrc. This of course requires a change to
the .procmailrc for every local user.

> hardware, certain large messages are taking too long to scan (two  
> minutes or more), and in some cases I'm accepting the message but the  
> sending MTA timed out, so I wind up receiving duplicate messages.  In  
> other cases, Sendmail just times out because mimedefang took too long  
> to respond, so Sendmail returning a tempfail.
> I'll be upgrading the hardware at the end of next month.  What are  
> some ideas until then?
> SpamAssassin scans most messages in only a second or two.

You could also limit the maximum size of the email you're scanning.
SpamAssassin is known to get pretty slow with larger emails. Since
most spam is smaller than 100k, you can get away with only scanning
mails smaller than 100k.

Jan-Pieter Cornet <johnpc at xs4all.nl>
!! Disclamer: The addressee of this email is not the intended recipient. !!
!! This is only a test of the echelon and data retention systems. Please !!
!! archive this message indefinitely to allow verification of the logs.  !!

More information about the MIMEDefang mailing list