mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-10-03 01:04:20 +08:00
LDAP local placeholder should return username when its not an email address (closes #1784)
This commit is contained in:
parent
4c954c93bd
commit
6e62f306ab
1 changed files with 6 additions and 3 deletions
|
@ -58,9 +58,12 @@ impl LdapFilter {
|
|||
LdapFilterItem::Static(s) => result.push_str(s),
|
||||
LdapFilterItem::Full => result.push_str(ldap_escape(value).as_ref()),
|
||||
LdapFilterItem::LocalPart => {
|
||||
if let Some((value, _)) = value.rsplit_once('@') {
|
||||
result.push_str(value);
|
||||
}
|
||||
result.push_str(
|
||||
value
|
||||
.rsplit_once('@')
|
||||
.map(|(local, _)| local)
|
||||
.unwrap_or(value),
|
||||
);
|
||||
}
|
||||
LdapFilterItem::DomainPart => {
|
||||
if let Some((_, domain)) = value.rsplit_once('@') {
|
||||
|
|
Loading…
Add table
Reference in a new issue