[Mimedefang] Disabling outbound mail filtering?

brian briane at geocel.com
Tue Oct 7 14:31:02 EDT 2003


>
>Brian,
>
>
>We do something similar at our office, although i'm not quite sure of the 
>quantity or size of our mail newsletter, when scanning each mail with SA 
>on the outbound, it was causing the mailing app to choke.
>
>Originally I implemented the following, but then made modifications to my 
>filter to still do bad extension and virus checking on outbound mail as 
>well.  it seems to still work fine for our purposes.
>
>if you want to skip *ALL* processing for outbound mail you could do 
>something like this:
>(i got this code from previous posts to this list)
  snip

Thanks to all who replied.  I really wanted to avoid having to hit the perl 
at all, since potentially a flood of incoming spam scans could starve out 
some of our outgoing mail jobs.  That's not really acceptable for us since 
our clients expect, and sometimes depend on timely delivery of these.

I finally decided to go into the mimedefang C code... hope you don't 
mind.  I just wanted to do something simple to see if it worked first, 
before making it nice and configurable (or at least that's my excuse anyway).

I'm pretty happy with the end result.  Even if the incoming mail scans 
choke the outgoing mail should still go out without too much of a 
problem.  My only concern is that I've possibly created a small memory 
leak... but I've been watching it pretty close recently and I'm not yet 
convinced one way or another.  Perhaps someone more familiar with the code 
can tell me?

Anyway, here's my hack.  In the eom function right before the perl scan call...

if(!strncmp(data->hostip, "xxx.xx.xx.", 10) )  //xxx.xx.xx. = my hardcoded 
class c.
{
   syslog(LOG_WARNING, "Scanning for outbound mail from %s skipped.", 
data->hostip);
   cleanup(ctx);
   return SMFIS_CONTINUE;
}

///////////  hack above... this just for positional reference.
/* Run the filter */
if (MXScanDir(MultiplexorSocketName, data->dir) < 0) {
   data->filterFailed = 1;
   cleanup(ctx);
   DEBUG_EXIT("eom", __LINE__, "SMFIS_TEMPFAIL");
   return SMFIS_TEMPFAIL;
}






More information about the MIMEDefang mailing list