[Mimedefang] Sendmail Skipping Filter

G.W. Haywood mimedefang at jubileegroup.co.uk
Tue Oct 21 12:18:42 EDT 2014


Hi there,

On Tue, 21 Oct 2014, Nathan F wrote:

> I have a mimedefang filter that discards all messages with
> "relayaddr ne 127.0.0.1".

I think you mean that's what you want it to do, but it doesn't. :)

> I am finding that some (a very small number) of mails are somehow
> being sent out.

Ah, yes. :)

> These mails are coming from an external system originally, but they
> don't seem to hit mimedefang's filter.  Any ideas?

Intrument the code.

> pseudo-code:
>
> filter_end {
>  if($RelayAddr ne '127.0.0.1') {
>    do processing;
>    discard;
>  }
> }

pseudo-patch:

filter_end {
   LOG_SOMETHING_USEFUL
   if($RelayAddr ne '127.0.0.1') {
     LOG_SOMETHING_USEFUL
     do processing;
     discard;
   }
   LOG_SOMETHING_USEFUL
}

> server log entry:
>
> Oct 20 10:16:09 inbound sendmail[12981]: s9K1G8oB012981: from=<a at b>,
> size=32820, class=0, nrcpts=1, msgid=<z at z>, proto=ESMTP, daemon=MTA,
> relay=ip-10-0-4-5 [10.0.4.5]
> Oct 20 10:31:21 inbound sendmail[6491]: s9K1G8oB012981: to=<d at e>,
> delay=00:15:12, xdelay=00:00:00, mailer=esmtp, pri=242820,
> relay=abc.com., dsn=5.3.5, stat=Local configuration error
> Oct 20 10:31:21 inbound sendmail[6491]: s9K1G8oB012981:
> s9K1VGlK006491: DSN: Local configuration error
> Oct 20 10:31:22 inbound sendmail[6491]: s9K1G8oB012981:
> s9K1VGlL006491: postmaster notify: Local configuration error

I see nothing there that's useful except the error message.

> Ignoring the fact that this is failing with an error ...

Don't do that.

> ... the important thing is ...

To find out what's going on.  I suspect your filter code isn't being
called at all in the cases where it fails to do what you want.  I like
to see this sort of thing in my logs:

Oct 21 17:01:14 mail5 mimedefang.pl[14765]: s9LG09SX004394: MDLOG,\
s9LG09SX004394,*=*=*=*=* filter_end(): \
processing message from IP [198.148.79.53],,,<clamav-devel-bounces at ...

73,
Ged.



More information about the MIMEDefang mailing list