Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Message

Re: [milter-greylist] Submitter DNS name resolution and forgery detection

2013-08-05 by Jim Klimov

On 2013-08-05 03:14, Jim Klimov wrote:
> Hello all,
>
> I am trying to make milter-greylist work with Sun/Oracle Messaging
> Server (part of Oracle unified Communications Suite now), and there
> is a problem which I've touched on recently - its partial milter-API
> implementation. While extending and porting some rulesets from our
> Sendmail-based relays, I found that the "domain" keyword only has
> the bracketed IP-quad as the submitter host's name, like "[1.2.3.4]".
>
> Since milter-greylist does use DNS a lot anyway (RBL, SPF, etc.)
> I wonder if it is possible to add a re-request into DNS for such
> botched remote client names? Perhaps there is already a keyword to
> enable such behavior?

To answer my own question, I did not find any relevant code in the
project that would do just that name resolution; but code in mx.c
was quite useful to make my own DNS queries. I attach the patch
which works for me in limited testing at least, may be quite noisy
in logs if debug is enabled.

I hope the list members can review this code for apparent errors
at least... but again - I have a test-case where it just works :)

It might make sense to enable this code-path with a config-file
option (i.e. for concerns about thread-unsafe resolvers), but I did
not get that far and I myself likely won't do it, either.

> Also, are there any configuration patterns to enable DNS-based
> tests that the remote host's HELO/EHLO name matches the textual
> name in the DNS PTR entry for its IP address, and that this name
> from DNS PTR resolves back to this IP address (or includes it
> among multiple values) - i.e. what I believe Sendmail does when
> estimating address "forgery"?

Now that I found how to do the DNS queries, making some logic to
detect such forgery (as a possibly new rule keyword in the overall
project structure) seems more feasible :) Though this, to be done
properly and prettily (with keywords, parsing, etc.) sounds too
complex for me to complete in my limited time.

Hope this helps, at least,
//Jim Klimov

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.