#14301: django crashes on email address that passed validate_email() (utf8-tld) ---------------------------------------+------------------------------------ Reporter: harm | Owner: nobody Status: reopened | Milestone: 1.3 Component: django.core.mail | Version: 1.2 Resolution: | Keywords: Stage: Accepted | Has_patch: 0 Needs_docs: 0 | Needs_tests: 0 Needs_better_patch: 1 | ---------------------------------------+------------------------------------ Changes (by jezdez):
* needs_better_patch: 0 => 1 Comment: Replying to [comment:13 philomat]: > The relevant Wikipedia article (German only, http://de.wikipedia.org/wiki/E-Mail- Adresse#Der_Dom.C3.A4nenteil_.28Domain_Part.29) says that with the introduction of IDN, nothing changes technically with regard to the SMTP protocol: Characters above ASCII code #127 are illegal. It is the client's responsibility to convert to an IDNA string. > > Hence, andialbrechts approach seems to be absolutely correct. Indeed, and the actual culprit seems to be the fact that to, cc and bcc attributes of an !EmailMessage are only idna encoded when calling its message() method (and blankly passed by the SMTP backend by using the recipients() method (see 1)). In other words, the encoding with idna needs to happen earlier in the life of an !EmailMessage, say in the `__init__` when the different recipient attributes are handled anyway (see 2). 1: http://code.djangoproject.com/browser/django/trunk/django/core/mail/message.py?rev=14216#L173 2: http://code.djangoproject.com/browser/django/trunk/django/core/mail/message.py?rev=14216#L121 -- Ticket URL: <http://code.djangoproject.com/ticket/14301#comment:16> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-upda...@googlegroups.com. To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-updates?hl=en.