#26496: AdminEmailHandler can produce mails violating RFC2822
---------------------------------+-----------------
     Reporter:  nijel            |      Owner:
         Type:  Bug              |     Status:  new
    Component:  Error reporting  |    Version:  1.9
     Severity:  Normal           |   Keywords:
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  0                |      UI/UX:  0
---------------------------------+-----------------
 The RFC2822 specifies maximal length of line in a message to 998
 characters (see also https://code.djangoproject.com/ticket/22561). However
 with AdminEmailHandler it's quite easy to reach it once settings contains
 some more complex dictionary, which is always printed on single line.

 The problematic template is TECHNICAL_500_TEXT_TEMPLATE in
 django/views/debug.py:

 https://github.com/django/django/blob/master/django/views/debug.py#L1121

 Specially this code:

 {{{
 Using settings module {{ settings.SETTINGS_MODULE }}{% for k, v in
 settings.items|dictsort:0 %}
 {{ k }} = {{ v|stringformat:"r" }}{% endfor %}
 }}}


 I think best approach would be to use pformat for formatting those entries
 same as is used for request parameters.

--
Ticket URL: <https://code.djangoproject.com/ticket/26496>
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 post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.691b793a04f4e004f5173753da0672a8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to