mirror of
https://github.com/stalwartlabs/mail-server.git
synced 2025-10-08 19:45:49 +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::Static(s) => result.push_str(s),
|
||||||
LdapFilterItem::Full => result.push_str(ldap_escape(value).as_ref()),
|
LdapFilterItem::Full => result.push_str(ldap_escape(value).as_ref()),
|
||||||
LdapFilterItem::LocalPart => {
|
LdapFilterItem::LocalPart => {
|
||||||
if let Some((value, _)) = value.rsplit_once('@') {
|
result.push_str(
|
||||||
result.push_str(value);
|
value
|
||||||
}
|
.rsplit_once('@')
|
||||||
|
.map(|(local, _)| local)
|
||||||
|
.unwrap_or(value),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
LdapFilterItem::DomainPart => {
|
LdapFilterItem::DomainPart => {
|
||||||
if let Some((_, domain)) = value.rsplit_once('@') {
|
if let Some((_, domain)) = value.rsplit_once('@') {
|
||||||
|
|
Loading…
Add table
Reference in a new issue