Yes sendmail kindly defers anything that spammers pass on...
You need custom Scheck_rcpt rules to match your LDAP directory
Main Topics
Browse All TopicsWe run a MailScanner (www.mailscanner.info) filter in front of our internal mail server. We want to restrict the inbound messages to valid recipient names only, and drop connections for unknown recipients. Obviously the filter does not have the users locally, so we want to get sendmail to check an LDAP database to see if the user is valid. It should then accept the message for forward, and send a 5xx error if the user is unknown ('551 go home, filthy spammer' would do).
I have checked through the sendmail docs and I can find some references to LDAP, but there doesn't seem to be a straightforward recipe to make reject/accept decisions based on this.
Bart...
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This is relatively pretty easy to set up. You'll most likely need to recompile sendmail with LDAP support built in. in your sendmail source directory, cd to devtools/Site and create a file called site.config.m4, in this file add the following two lines:
APPENDDEF(`confMAPDEF', `-DLDAPMAP -I/usr/local/include')
APPENDDEF(`confLIBS', `-L/usr/local/lib -lldap -llber')
(you might have to adjust the pathnames to match the locatations of your ldap libs on your server).
Once this is done, you will need to recompile and reinstall sendmail.
Now, in your sendmail.mc file, add the following lines:
FEATURE(ldap_routing,,,bou
LDAPROUTE_DOMAIN(`yourdoma
define(`confLDAP_DEFAULT_S
Rebuild your sendmail.cf file from the mc file and you should be off and running. Your LDAP schema should contain the following attributes:
objectClass=inetLocalMailR
mailLocalAddress=user@your
So, when a new email comes in, sendmail will look for a user in LDAP with an objectclass of inetLocalMailRecipient and a mailLocalAddress that matches the recipient address. If this match is not made, it will bounce the message.
More info can be found here:
http://www.sendmail.org/m4
Business Accounts
Answer for Membership
by: jleviePosted on 2003-12-26 at 22:47:06ID: 10004451
I don't know of a way to do this easily with LDAP at the sendmail level. However, it would be pretty easy to write a Perl script that:
l-hosting. html)
1) Extracts the list of valid email addresses from LDAP
2) Builds a temp copy of virtusertable with the "catchall" set to reject with error message (see http://sendmail.org/virtua
3) Diffs the current virtusertable against the temp copy and rebuilds the map if they are different.
Running such a script from cron, say every 15 or 30 minutes, would not impose a significant load on your MailScanner system and it would accomplish your goal.