Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#1139 closed defect (fixed)

Bug in email.txt documentation example code

Reported by: Simon Willison Owned by: adrian
Component: Core (Other) Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The header injection example code in only checxs for '\n' in the headers, but Django itself checks for '\r' instead. Suggestion: instead of throwing a ValueError in the SafeMIMEText class throw a "BadHeaderError" (or similarly named) that is a subclass of ValueError. The example code can then try to send the email and show an error if it catches that exception.

Change History (1)

comment:1 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

(In [1798]) Fixed #1139 -- Changed django.core.mail to raise BadHeaderError (a subclass of ValueError) and changed docs/email.txt example to use that

Note: See TracTickets for help on using tickets.
Back to Top