Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with some emails #66

Open
battosai30 opened this issue Dec 8, 2020 · 0 comments
Open

Problem with some emails #66

battosai30 opened this issue Dec 8, 2020 · 0 comments

Comments

@battosai30
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant