From 0104adb645c864098e668981103c2c54bf9e40c8 Mon Sep 17 00:00:00 2001 From: "Eugene S. Sobolev" Date: Mon, 3 Feb 2025 13:43:09 +0300 Subject: [PATCH] Use LDAP DN from search if prefix/suffix not defined --- mailscanner/functions.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mailscanner/functions.php b/mailscanner/functions.php index 7e9d659f..87f1f52a 100644 --- a/mailscanner/functions.php +++ b/mailscanner/functions.php @@ -3018,6 +3018,9 @@ function ldap_authenticate($username, $password) if (defined('LDAP_BIND_SUFFIX')) { $user .= LDAP_BIND_SUFFIX; } + if (!defined('LDAP_BIND_PREFIX') && !defined('LDAP_BIND_SUFFIX')) { + $user=$result[0]['dn']; + } if (!isset($result[0][LDAP_EMAIL_FIELD])) { @trigger_error(__('ldapno03') . ' "' . LDAP_EMAIL_FIELD . '" ' . __('ldapresults03'));