Projet

Général

Profil

Bug #6119

Error validating emails with accentuated characters

Ajouté par Frédéric Péters il y a plus de 9 ans. Mis à jour il y a environ 9 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
-
Catégorie:
-
Version cible:
Début:
07 décembre 2014
Echéance:
% réalisé:

100%

Temps estimé:
Patch proposed:
Non
Planning:

Description

UnicodeEncodeError: 'ascii' codec can't encode character u'\xe0' in position 6....

  File "authentic2/validators.py", line 44, in __call__
    mxs = self.check_mxs(hostname)
  File "authentic2/validators.py", line 30, in check_mxs
    socket.gethostbyname(force_text(domain))

Note that this code part happens when dns.resolver fails to find an MX (I tested briefly and dns.resolver works with unicode domains).

Révisions associées

Révision 72f64334 (diff)
Ajouté par Benjamin Dauvergne il y a plus de 9 ans

Validate email domain containing non ASCII characters

fixes #6119

Historique

#1

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

Is there something better than just checking that the email contains only ascii characters ? Should I convert the domain to the IDNA encoding ? In this case the faulting line could be replaced by:

socket.gethostbyname(force_text(domain).encode('idna'))
#2

Mis à jour par Frédéric Péters il y a plus de 9 ans

From what I read .encode('idna') is correct (I should have mentioned it as I researched it for wcs).

#3

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Statut changé de Nouveau à Résolu (à déployer)
  • % réalisé changé de 0 à 100
#4

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Version cible mis à 2.1.12
#5

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Statut changé de Résolu (à déployer) à Fermé

Formats disponibles : Atom PDF