need help blocking emails to non-existent users

Richard Frovarp richard.frovarp at sendit.nodak.edu
Wed Dec 19 22:32:48 GMT 2007


Joey Marino wrote:
> I am currently running a mailscanner box on centos using sendmail that 
> relays to my exchange server.  I am trying to block email to 
> non-existent users at the smtp level on the MX. I understand I have to 
> somehow update sendmail with existent users in the active directory 
> possibly using ldap. I can't seem to find any good documentation on 
> how to do this. Many entries in the archive point to 
> http://www.mailscanner.info/serve/cache/270.html but this doesn't 
> exist anymore. I also found a sketchy bash script at 
> http://the-jer.spaces.live.com/blog/cns!E4FBBD09FA146AF!128.entry 
> <http://the-jer.spaces.live.com/blog/cns%21E4FBBD09FA146AF%21128.entry> 
> but I don't like this approach either. I want to do all the work on 
> the gateway. Can somebody point me to some good documentation or a 
> healthy script that I could use to accomplish this?

What does your LDAP look like? Do you have mailLocalAddress and 
mailRoutingAddress information or something similar? If so, just use the 
LDAP-routing feature inside of sendmail.

http://www.sendmail.org/m4/ldap_routing.html

This way you don't have to worry about syncing anything. Load shouldn't 
be an issue either as it works quite quickly against Open LDAP. That 
should reject for users not in LDAP or who don't have the correct 
information in LDAP.


More information about the MailScanner mailing list