Project

General

Profile

Bug #24409

envoi d'email à des domaines non ascii

Added by Frédéric Péters about 1 year ago. Updated about 1 year ago.

Status:
Nouveau
Priority:
Normal
Assignee:
-
Start date:
10 Jun 2018
Due date:
% Done:

0%

Patch proposed:
No
Planning:
No

Description

Failed to send mail to ['xxx@num\xc3\xa9ricable.fr']

>>> domain = u"numéricable.fr".encode('idna')
>>> domain
'xn--numricable-d7a.fr'
>>> import DNS
>>> DNS.ParseResolvConf()
>>> DNS.mxlookup(domain)
[(10, 'mta.pro.numericable.fr')]

De https://bugs.python.org/issue20083 ce n'est toujours pas gagné. On devrait filtrer et convertir en idna les adresses avant de les passer à smtplib.

History

#1 Updated by Frédéric Péters about 1 year ago

Aussi,

>>> s = smtplib.SMTP('localhost')
>>> s.sendmail('test@entrouvert.com', ['xxx@numéricable.fr'], '')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/smtplib.py", line 747, in sendmail
    raise SMTPRecipientsRefused(senderrs)
smtplib.SMTPRecipientsRefused: {'xxx@num\xc3\xa9ricable.fr': (501, '<xxx@num\xc3\xa9ricable.fr>: malformed address: \xc3\xa9ricable.fr> may not follow <xxx@num')}

Also available in: Atom PDF