Hello,
I'm struggling with integrating OpenSMTPD with an LDAP backend to verify
users based on their full email addresses. Despite using the rcpt-to
option in my LMTP configuration, OpenSMTPD seems to only check the local
part of the email address (e.g., user instead of u...@example.com)
against the LDAP directory.
My OpenSMTPD Configuration (/etc/mail/smtpd.conf):
table localdomains file:/etc/mail/localdomains
table users ldap:///etc/mail/ldapusers.conf
listen on 127.0.0.1 port 587
action "local_mail" lmtp "/var/dovecot/lmtp" rcpt-to
match from any for domain <localdomains> action "local_mail"
match from local for any action "outbound"
In the debug logs, I see OpenSMTPD querying LDAP with only the local
part of the email (uid=test), instead of the full email address
(uid=t...@example.org). As a result, valid email addresses are not being
found in the LDAP directory, and I'm getting a "550 Invalid recipient"
error.
users[9900]: debug: table_ldap: ldap_query:
filter=(&(objectclass=posixaccount)(uid=test)), ret=0
users[9900]: debug: table_ldap: ldap_query:
filter=(&(objectclass=posixaccount)(uid=test)), ret=0
lookup: lookup "test" as USERINFO in table proc:users -> none
expand: lka_expand: user-part does not match system user
smtp: 0x7d457d83000: >>> 550 Invalid recipient: <t...@example.org>
Has anyone encountered similar issues with OpenSMTPD not using the full
email address for LDAP queries? Is there a workaround or configuration
adjustment that I’m missing to make OpenSMTPD use the full address for
user verification?
Any help or pointers would be greatly appreciated!
Best regards,
Bambero