Sendmail LDAP integration (failure)

Hey, I’m trying to integrate sendmail and openLDAP together.

I’ve followed the guide in O’Reilly’s LDAP book and my lookups are good.

I think my problem is virtual users. What I’m trying to accomplish is that if an email is sent to joe@host.tld and there is an entry in LDAP for joe then it’ll be accepted. Right now, it’ll only accept emails only for system users.

Below is my sendmail.mc (most comments removed)


divert(-1)dnl

include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
VERSIONID(`setup for linux')dnl
OSTYPE(`linux')dnl

dnl ##  I have a real one
define(`SMART_HOST', `my.smart.host')dnl
dnl #
define(`confDEF_USER_ID', ``8:12'')dnl
dnl define(`confAUTO_REBUILD')dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTRY_NULL_MX_LIST', `True')dnl
define(`confDONT_PROBE_INTERFACES', `True')dnl
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl

dnl ##Changed by me 6/21/11 for LDAP ALIAS
define(`ALIAS_FILE', `ldap:-k (&(objectClass=sendmailMTAAliasObject)(sendmailMTAKey=%0)) -v sendmailMTAAliasValue -b "ou=aliases,ou=sendmail,ou=services,dc=sailorcire,dc=homelinux,dc=com"')dnl
define(`STATUS_FILE', `/var/log/mail/statistics')dnl
define(`UUCP_MAILER_MAX', `2000000')dnl
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl

define(`confTO_IDENT', `0')dnl
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa', `dnl')dnl
FEATURE(`smrsh', `/usr/sbin/smrsh')dnl
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl

dnl ##Changed by me 6/29/11 for Virtual Users in LDAP?
FEATURE(`virtusertable', `ldap: -k (&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0)) -b "ou=People,dc=sailorcire,dc=homelinux,dc=com"')dnl

FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl

FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl

dnl ##Changed by me for LDAP on 6/13/11
FEATURE(`access_db', `hash -T<TMPF> -o /etc/mail/access.db')dnl
LDAPROUTE_DOMAIN(`sailorcire.homelinux.com')dnl
FEATURE(`ldap_routing')dnl
define(confLDAP_DEFAULT_SPEC, `-h localhost -b ou=People,dc=sailorcire,dc=homelinux,dc=com')dnl

FEATURE(`blacklist_recipients')dnl
EXPOSED_USER(`root')dnl

DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl

FEATURE(`accept_unresolvable_domains')dnl
dnl #
dnl FEATURE(`relay_based_on_MX')dnl

define(`confDOMAIN_NAME', `sailorcire.homelinux.com')dnl
FEATURE(`relay_entire_domain')dnl
LOCAL_DOMAIN(`sailorcire.homelinux.com')dnl

MASQUERADE_AS(`sailorcire.homelinux.com')dnl

FEATURE(masquerade_envelope)dnl

FEATURE(masquerade_entire_domain)dnl

MAILER(smtp)dnl
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl

If I’m not clear on what I want or can provide more, please let me know. I’m hoping it’s something that’s just staring me in the face that I’m missing.

what does /etc/mail/userdb.d contain?

Thanks for your response! That file does not exist. How would one go about creating it?