Merge pull request #1882 from ZephOne/also-use-ldap-login-mapping-for-smtp-user

Also use ldap login mapping for smtp user
This commit is contained in:
Maarten 2026-10-22 14:10:42 +02:00 • committed by GitHub
commit 4997853b78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 4 deletions

View file

@ -1 +1 @@
Plugin which allows you to set up LDAP username by email address (when IMAP/SMTP requires it)
This plugins allows to authenticate using LDAP mail field, yet login field would still be used for IMAP and SMTP authentication.

View file

@ -8,12 +8,12 @@ class LDAPLoginMappingPlugin extends AbstractPlugin
{
const
NAME = 'LDAP login mapping',
VERSION = '2.3',
VERSION = '2.4',
AUTHOR = 'RainLoop Team, Ludovic Pouzenc<ludovic@pouzenc.fr>, ZephOne<zephone@protonmail.com>',
RELEASE = '2024-09-20',
RELEASE = '2024-01-09',
REQUIRED = '2.36.1',
CATEGORY = 'Login',
DESCRIPTION = 'Enable custom mapping using ldap field';
DESCRIPTION = 'This plugins allows to authenticate using LDAP mail field, yet login field would still be used for IMAP and SMTP authentication';
/**
* @var array
*/
@ -104,6 +104,7 @@ class LDAPLoginMappingPlugin extends AbstractPlugin
$sResult = $this->ldapSearch($sEmail);
if ( is_array($sResult) ) {
$sImapUser = $sResult['login'];
$sSmtpUser = $sResult['login'];
$sEmail = $sResult['email'];
}
syslog(LOG_WARNING, "plugins/ldap-login-mapping/index.php:FilterLoginСredentials() auth try: $sIP/$sEmail, resolved as $sImapUser/$sEmail");