Skip to content

Problem with some emails #66

@battosai30

Description

@battosai30

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions