Hi,
Trying to add a user to my ldap, I met an "Error occured". Looking at stdout, I found that the email wasn't recognize as valid (format was xxxx.yyy-zzz@example.com). I found that the '-' was the problem. Digging into the code I found that _is_email function in /usr/lib/python3.8/site-packages/ldapcherry-1.1.1-py3.8.egg/ldapcherry/attributes.py file was the problem.
So I modified it to :
def _is_email(self, email):
# pattern = r'[\+\.\w]+@[-\.\w]+\.\w+'
# if re.match(pattern, email):
return True
# else:
# return False
Email is not checked at all now but it works, user may be more vigilent now ...
I think the pattern is too basic and this function deserves a better algo ;)
I'm don't know Python at all so I can't do the modification myself :s
Regards
Hi,
Trying to add a user to my ldap, I met an "Error occured". Looking at stdout, I found that the email wasn't recognize as valid (format was xxxx.yyy-zzz@example.com). I found that the '-' was the problem. Digging into the code I found that _is_email function in
/usr/lib/python3.8/site-packages/ldapcherry-1.1.1-py3.8.egg/ldapcherry/attributes.pyfile was the problem.So I modified it to :
Email is not checked at all now but it works, user may be more vigilent now ...
I think the pattern is too basic and this function deserves a better algo ;)
I'm don't know Python at all so I can't do the modification myself :s
Regards