#35497: Long email address causes crash when generating a message
-------------------------------------+-------------------------------------
     Reporter:  Alexandru Chirila    |                    Owner:  Clinton
                                     |  Christian
         Type:  Bug                  |                   Status:  assigned
    Component:  Core (Mail)          |                  Version:  5.0
     Severity:  Normal               |               Resolution:
     Keywords:  email, compat32      |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mike Edmunds):

 * cc: Mike Edmunds (added)
 * keywords:   => email, compat32

Comment:

 [This issue would also be solved—without altering line length—by upgrading
 django.core.mail from legacy email.message.Message (policy=compat32) to
 modern email.message.EmailMessage (policy=default), and letting the modern
 email package handle header sanitization and folding. Though that's a much
 larger scope than this individual bug.]

 {{{#!python
 import email.message
 msg = email.message.EmailMessage()
 msg["To"] = "ţēśţ." * 6 + "@example.com"
 print(msg.as_bytes().decode("ascii"))
 # To:
 =?utf-8?b?xaPEk8WbxaMuxaPEk8WbxaMuxaPEk8WbxaMuxaPEk8WbxaMuxaPEk8WbxaMu?=
 #  =?utf-8?b?xaPEk8WbxaM=?=.@example.com
 }}}
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35497#comment:7>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701904662bede-bf997e2b-6d9f-4e08-8513-5085179f0077-000000%40eu-central-1.amazonses.com.

Reply via email to