Allow LDAP Authentication using samAccountName
Summary
I would like Mailcow’s LDAP authentication to support logging in with either the user’s samAccountName or full email address.
Example environment
- Active Directory:
ad.my-domain.com - Mail domain:
my-domain.com samAccountName:max.mustermannmail:[email protected]
Both usernames should authenticate against the same LDAP/AD account, using the same password, and resolve to the same Mailcow mailbox:
max.mustermann[email protected]
Suggested implementation
Support multiple LDAP login attributes:
samAccountNamemail
Conceptually, the LDAP search could use:
(|(samAccountName={username})(mail={username}))
The mailbox attribute remains mail.
Motivation
This would allow AD/LDAP environments to support both common login formats without choosing one exclusively. Applications using samAccountName and mail clients/users using the email address could authenticate against the same LDAP account and mailbox.
Additional context
No response
Source: mailcow/mailcow-dockerized