Sendmail + LDAP Rouing CHANGELOG: * Thu Dec 20 2001 - Initial roll-out SYNOPSIS: Quick HOWTO for hooking up sendmail to LDAP for mail routing DESCRIPTION: REQUIREMENTS: Sendmail compiled with LDAP support. Check by running: godzilla:~# sendmail -d0.1 -bv root|grep LDAP Compiled with: DNSMAP HESIOD LDAPMAP LOG MAP_REGEX MATCHGECOS MILTER COMPILATION: Assume that Sendmaili is compiled with LDAP soupport. Most distros i tested came with LDAP compiled in by default. INSTALLATION: Assume that sendmail is installed. CONFIGURATION: Edit sendmail.mc and add the following into it FEATURE(`ldap_routing') LDAPROUTE_DOMAIN(`example.com') define(`confLDAP_DEFAULT_SPEC',`-h"ldap.example.com" -b"o=example.com"') The "FEATURE" flag should be before any "MAILER" flags in the .mc file. Genearate the .cf file and restart sendmail. Sample LDAP entries: dn: uid=shanu, o=example.com objectClass: inetLocalMailRecipient mailLocalAddress: shanu@example.com mailRoutingAddress: shankerbalan@mailhost.example.com This will send redirect all mails for "shanu@example.com" to "shankerbalan@mailhost.example.com". The MX is automatically looked by sendmail for mailhost.example.com dn: uid=shanu, o=example.com objectClass: inetLocalMailRecipient mailLocalAddress: shanu@example.com mailhost: in.example.com This would relay mail for shanu@example.com to the same address but redirect the mail to MX records listed for the host in.example.com (unless the mailertable overrides). dn: uid=shanu, o=example.com objectClass: inetLocalMailRecipient mailLocalAddress: shanu@example.com mailhost: in.example.com mailRoutingAddress: shanker.balan@in.example.com Same as above, except that the mail will be relayed to in.example.com and delivered to shanker.balan@in.example.com. dn: uid=blr.example.com, o=example.com objectClass: inetLocalMailRecipient mailLocalAddress: @blr.example.com mailHost: in.example.com mailRoutingAddress: blr@example.com All mails destined for the virtual domain "@blr.example.com" will be relayed to "in.example.com" to the mail address "blr@example.com" TESTING: Just try sending mails. It should resolve all addresses. SEE ALSO: 1. Sendmail cf.README 2. LDAP Routing Made Easy http://sendmail.net/ldaprouting.shtml 3. Sendmail + LDAP HOWTO http://www.iconimaging.net/~jradford/sendmail/sendmail-ldap.html BUGS: Dunno TODO: Migrate other flatdbs to LDAP AUTHOR: Shanker Balan http://shankerbalan.com/