diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index e2f47d96..8993559a 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -124,17 +124,17 @@ def mailexist(mail): du serveur mail """ + mail = mail.split('@', 1)[0] + try: s = smtplib.SMTP(smtpserv) - r = s.vrfy(mail) + s.putcmd("vrfy", mail) + r = s.getreply()[0] in [250, 252] s.close() except: raise ValueError(u'Serveur de mail injoignable') - if r[0] in [250, 252]: - return True - else: - return False + return r def preattr(val): """