Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Avoid processing invalid email addresses in milter?

8 views
Skip to first unread message

Neil

unread,
Aug 28, 2009, 1:05:19 PM8/28/09
to
Hello:

We have a custom spam filtering service implemented as
a milter.

We have noticed the milter is getting called for every SMTP
request to the server, even if the request is for an invalid
email address, like z...@jammconsulting.com

Since those email addresses are going to be rejected by the
server as invalid anyway, we would like to avoid processing them in
the milter.

Is there a way to do that?

Thanks,
Neil

--
Neil Aggarwal, (281)846-8957, www.JAMMConsulting.com
NEW! Milter based spam blocking. Easy to use, 100% effective.
Register for FREE at http://JunkMailBlocker.net

Grant Taylor

unread,
Aug 28, 2009, 2:04:28 PM8/28/09
to
On 08/28/09 12:05, Neil wrote:
> Since those email addresses are going to be rejected by the server as
> invalid anyway, we would like to avoid processing them in the milter.
>
> Is there a way to do that?

I don't think there is a way that you can avoid your milter being
called. Though I don't think there is any reason why your milter has to
actually do any thing if it is obvious that the message will be
rejected. I.e. you could return an dummy "ok" and not do any in depth
processing.

Grant. . . .

Neil

unread,
Aug 28, 2009, 3:42:54 PM8/28/09
to
On Aug 28, 1:04 pm, Grant Taylor <gtay...@riverviewtech.net> wrote:
> I don't think there is a way that you can avoid your milter being
> called.

Thanks for the info. I was hoping there was something
we could put into the sendmail.mc file, like delay_checks
or something.

Grant Taylor

unread,
Aug 28, 2009, 3:46:04 PM8/28/09
to
On 08/28/09 14:42, Neil wrote:
> Thanks for the info.

You are welcome.

> I was hoping there was something we could put into the sendmail.mc
> file, like delay_checks or something.

I'm not saying that there isn't. Just that from my (mis)understanding
of how milters work, I would not be surprised if there isn't.

Grant. . . .

Grant Taylor

unread,
Aug 28, 2009, 3:50:10 PM8/28/09
to
On 08/28/09 14:46, Grant Taylor wrote:
> I'm not saying that there isn't. Just that from my (mis)understanding
> of how milters work, I would not be surprised if there isn't.

You may want to check out "milter manager". With out having used it my
self, I get the impression that it can add some logic in to milter
processing. I don't know if this means that subsequent milters will
only be called if previous milters don't reject messages or if different
sets of milters are applied based on connecting IP or what. But you
might want to give it a look.

In short, milter manager interfaces with Sendmail like a normal milter
and then it acts like Sendmail talking to other milters behind it. I.e.

Sendmail <-> milter manager <-> milter1
<-> milter2

Link - Introduction - milter manager
- http://milter-manager.sourceforge.net/reference/introduction.html

Grant. . . .

D. Stussy

unread,
Aug 28, 2009, 3:57:08 PM8/28/09
to
"Neil" <ne...@JAMMConsulting.com> wrote in message
news:3d7c38e0-da50-4776...@a13g2000yqc.googlegroups.com...

> We have a custom spam filtering service implemented as
> a milter.
>
> We have noticed the milter is getting called for every SMTP
> request to the server, even if the request is for an invalid
> email address, like z...@jammconsulting.com
>
> Since those email addresses are going to be rejected by the
> server as invalid anyway, we would like to avoid processing them in
> the milter.
>
> Is there a way to do that?

Are you certain. I believe that milters are NOT called when the
corresponding ruleset has rejected that element of the message. The
rulesets do run first.


Neil

unread,
Aug 28, 2009, 6:16:12 PM8/28/09
to
On Aug 28, 2:57 pm, "D. Stussy" <s...@bde-arc.ampr.org> wrote:
> Are you certain.  I believe that milters are NOT called when the
> corresponding ruleset has rejected that element of the message.  The
> rulesets do run first.

I am seeing logs of the milter processing addresses that are invalid.
They eventually result in a User unknown response from the server.

D. Stussy

unread,
Aug 29, 2009, 2:24:14 AM8/29/09
to
"Neil" <ne...@JAMMConsulting.com> wrote in message
news:d2ae8a41-3303-4135...@c2g2000yqi.googlegroups.com...

On Aug 28, 2:57 pm, "D. Stussy" <s...@bde-arc.ampr.org> wrote:
> Are you certain. I believe that milters are NOT called when the
> corresponding ruleset has rejected that element of the message. The
> rulesets do run first.

I am seeing logs of the milter processing addresses that are invalid.
They eventually result in a User unknown response from the server.

---------
Did your sendmail ruleset reject the address? I suspect not.

Performing a lookup to the system for a valid user isn't part of ruleset
processing. It comes later, especially since recipients can be altered by
milters.


Neil

unread,
Aug 29, 2009, 10:40:26 AM8/29/09
to
On Aug 29, 1:24 am, "D. Stussy" <s...@bde-arc.ampr.org> wrote:
> Did your sendmail ruleset reject the address?  I suspect not.
>
> Performing a lookup to the system for a valid user isn't part of ruleset
> processing.  It comes later, especially since recipients can be altered by
> milters.

OK, I think I understand what you are saying,

Processing the virtusertable happens after the milter.

How do I set up blocking in the rulesets? I assume
that will be in sendmail.mc, correct?

D. Stussy

unread,
Aug 29, 2009, 11:26:12 PM8/29/09
to
"Neil" <ne...@JAMMConsulting.com> wrote in message
news:46c52417-d70b-476d...@r36g2000vbn.googlegroups.com...

On Aug 29, 1:24 am, "D. Stussy" <s...@bde-arc.ampr.org> wrote:
> Did your sendmail ruleset reject the address? I suspect not.
>
> Performing a lookup to the system for a valid user isn't part of ruleset
> processing. It comes later, especially since recipients can be altered by
> milters.

OK, I think I understand what you are saying,

Processing the virtusertable happens after the milter.

-----

NO! That happens during the ruleset.
----

How do I set up blocking in the rulesets? I assume
that will be in sendmail.mc, correct?

-----
RTFM.


David F. Skoll

unread,
Aug 30, 2009, 6:47:10 AM8/30/09
to
D. Stussy wrote:

> RTFM.

Actually, everyone should RTFM, specifically
https://www.milter.org/developers/api/xxfi_negotiate and the
SMFIP_RCPT_REJ flag. Sendmail 8.14.x only, alas.

Regards,

David.

Neil

unread,
Aug 30, 2009, 8:00:47 PM8/30/09
to
On Aug 29, 10:26 pm, "D. Stussy" <s...@bde-arc.ampr.org> wrote:
> Processing the virtusertable happens after the milter.
> NO!  That happens during the ruleset.

OK, I *finally* figured out what you were saying.
I added:
@jammconsulting.com error:nouser 550 No such user
to the bottom of my virtusertable and now I don't see non-listed
addresses in the milter log.

Thanks,
Neil

0 new messages