Bug #41894
crash validation spf
Début:
20 avril 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
File "/usr/lib/python3/dist-packages/django/forms/fields.py" in clean 161. self.validate(value) File "/usr/lib/python3/dist-packages/hobo/emails/forms.py" in validate 27. validate_email_spf(value) File "/usr/lib/python3/dist-packages/hobo/emails/validators.py" in validate_email_spf 59. spf_records = [x for x in txt_records if x.startswith('v=spf1 ')] File "/usr/lib/python3/dist-packages/hobo/emails/validators.py" in <listcomp> 59. spf_records = [x for x in txt_records if x.startswith('v=spf1 ')] Exception Type: TypeError at /emails/ Exception Value: startswith first arg must be bytes or a tuple of bytes, not str
Fichiers
Demandes liées
Révisions associées
Historique
Mis à jour par Frédéric Péters il y a environ 4 ans
- Fichier 0001-emails-handle-DNS-TXT-entries-as-the-bytes-they-are-.patch 0001-emails-handle-DNS-TXT-entries-as-the-bytes-they-are-.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Un peu réécrit parce que je n'ai pas trouvé bien claire cette ligne :
txt_records = sum([r.strings for r in dns.resolver.query(email_domain, 'TXT')], [])
Mis à jour par Thomas Noël il y a environ 4 ans
- Statut changé de Solution proposée à Solution validée
Le txt_records = []
dans le except peut être remplacé par un pass, à mon avis. Mais go, ça marche ainsi.
Mis à jour par Frédéric Péters il y a environ 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
(j'ai mis le pass)
commit 22bbfcdb4463e96922cd33ca74e3b7adea68b83a Author: Frédéric Péters <fpeters@entrouvert.com> Date: Mon Apr 20 17:57:36 2020 +0200 emails: handle DNS TXT entries as the bytes they are (#41894)
Mis à jour par Frédéric Péters il y a environ 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
Mis à jour par Christophe Siraut il y a environ 4 ans
- Lié à Bug #41906: TypeError: startswith first arg must be bytes or a tuple of bytes, not str ajouté
emails: handle DNS TXT entries as the bytes they are (#41894)