Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also use ldap login mapping for smtp user #1882

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/ldap-login-mapping/README
Original file line number Diff line number Diff line change
@@ -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.
7 changes: 4 additions & 3 deletions plugins/ldap-login-mapping/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -104,6 +104,7 @@ public function FilterLoginСredentials(string &$sEmail, string &$sImapUser, str
$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");
Expand Down
Loading