#28726: Brackets illegal in DEFAULT_FROM_EMAIL name part
-------------------------------------+-------------------------------------
     Reporter:  Ciaran Courtney      |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  Core (Mail)          |                  Version:  1.11
     Severity:  Normal               |               Resolution:
     Keywords:  email                |             Triage Stage:  Accepted
  DEFAULT_FROM_EMAIL                 |
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

 * type:  Bug => Cleanup/optimization
 * easy:  1 => 0


Comment:

 Changing the default value to a tuple could be backwards incompatible.

 I'm not sure if documentation is needed here, however, it could be helpful
 to improve the exception:
 {{{
   File "/home/tim/code/django/tests/mail/tests.py", line 845, in
 test_html_send_mail
     send_mail('Subject', 'Content', '[test] Bob <[email protected]>',
 ['[email protected]'], html_message='HTML Content')
   File "/home/tim/code/django/django/core/mail/__init__.py", line 62, in
 send_mail
     return mail.send()
   File "/home/tim/code/django/django/core/mail/message.py", line 349, in
 send
     return self.get_connection(fail_silently).send_messages([self])
   File "/home/tim/code/django/django/core/mail/backends/smtp.py", line
 111, in send_messages
     sent = self._send(message)
   File "/home/tim/code/django/django/core/mail/backends/smtp.py", line
 123, in _send
     from_email = sanitize_address(email_message.from_email, encoding)
   File "/home/tim/code/django/django/core/mail/message.py", line 161, in
 sanitize_address
     address = Address(nm, addr_spec=addr)
   File "/home/tim/code/cpython/Lib/email/headerregistry.py", line 42, in
 __init__
     a_s, rest = parser.get_addr_spec(addr_spec)
   File "/home/tim/code/cpython/Lib/email/_header_value_parser.py", line
 1986, in get_addr_spec
     token, value = get_local_part(value)
   File "/home/tim/code/cpython/Lib/email/_header_value_parser.py", line
 1798, in get_local_part
     if value[0] in CFWS_LEADER:
 IndexError: string index out of range
 }}}
 That might involve patching cpython rather than Django.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28726#comment:3>
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/072.5948648245ec9e0aa2e3291b88c6be15%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to