[Mimedefang] relaying for multiple domains and servers and LDAP lookups

David F. Skoll dfs at roaringpenguin.com
Wed Apr 21 08:42:18 EDT 2004


On Wed, 21 Apr 2004 WBrown at e1b.org wrote:

> Is there a way (hopefully easy) to configure sendmail or mimedefang to
> query a number of different servers to validate email recipients before
> accepting a message.

What's your definition of "easy"? :-)

The obvious way is to have a per-domain table of which server to do the
lookup against.  Something like:

    %ldap_servers = ( 'domain1.com' => 'ldap.domain1.com',
                      'abc.net'     => 'directory.abc.net');

    # Extract domain from address -- may need to remove angle brackets,
    # make lower-case, etc.
    $domain = $addr;
    $domain =~ s/.*\@//;
    $server = $ldap_servers{$domain};
    if (defined($server)) {
        # Do the LDAP lookup
    }

> Another alternative would be to pull the information from all the end mail
> servers using LDAP and dump it all into one local LDAP directory.  I could
> then query that local server (which would not require remote server to
> even be up).

That's also a possibility.  You don't need the whole LDAP directory; all
you need is a list of valid addresses.  You could dump that into an access
table and do it all in Sendmail.

Regards,

David.



More information about the MIMEDefang mailing list