Reject non-existant users with exchange and exim

Kosta Lekas KLekas at
Fri Apr 21 14:29:51 IST 2006

There is a better way to pull a list of valid users from Exchange. There
is a Perl script out there that pulls all the smtp addresses form AD
using Net::LDAP. This is what I use to generate a relay_recipient list
on Postfix. I'm sure it can be tailored to generate an exim equivalent
file/ACL. The script queries an AD container and pulls all smtp
addresses. I keep my private distribution groups in a separate OU that
gets excluded from the LDAP search, this way I don't have to relay
private distribution groups that should only be originating internally.
The method Rob has referenced will also work but I find this one to be
more elegant.

Here is a link to directions on doing this with postfix:
Here is a link to the script:

Kosta Lekas

-----Original Message-----
From: mailscanner-bounces at
[mailto:mailscanner-bounces at] On Behalf Of Rob
Sent: Thursday, April 20, 2006 7:08 PM
To: MailScanner discussion
Subject: Re: Reject non-existant users with exchange and exim

Check out here:

We use this with a few tweaks to only allow email to our valid exchange


chardlist wrote:
> In the wiki documentation I see methods how to set up exim routers to
> mail and then pass it along to another server (exchange in this case),
but I
> don't see a way to configure the exchange server and the ms server to
> communicate about valid addresses so that the mta on the mailscanner
> (exim) can reject the message before mailscanner has to deal with it.
> now I am leaving the mailscanner server open to accept any mail to the
> domain with the exchange server and it's getting a bit out of hand.
> I realize this is more of an exim question, but I figure this is a
> place to start.
> MS 4.50.14
> Exim 4.52
> Redhat 9
> Thank you,
> -Brendan

MailScanner mailing list
mailscanner at

Before posting, read

Support MailScanner development - buy the book off the website! 

More information about the MailScanner mailing list