]> git.proxmox.com Git - pmg-api.git/commit
fix #3924: ldap: accept only valid email-address
authorMarkus Frank <m.frank@proxmox.com>
Wed, 30 Mar 2022 12:32:15 +0000 (14:32 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Mon, 4 Apr 2022 13:35:45 +0000 (15:35 +0200)
commit49209fdc603bdc7ee082636dce03b4111f31d6d7
tree837b3c07efac2a541412ea013761359a73dade82
parent9c1ed3883509f3a919ab768021be00150e4f9707
fix #3924: ldap: accept only valid email-address

If a mail attribute contains special characters in ldap at the first
line, it will be set as primary email and results in a
"400 invalid format - value does not look like a valid email address"
Error-Statement in the webconsole. This mostly can happen if SIP
Addresses are in Active-Directory's proxyAddresses which begin with "SIP:".

To make the validation more strict I changed the api to use
pmg-email-address and added a regex which looks for protocolnames (sip:)
that could be in proxyAddresses but are not compatible and skips these
addresses.

Signed-off-by: Markus Frank <m.frank@proxmox.com>
src/PMG/API2/LDAP.pm
src/PMG/LDAPCache.pm