Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #22561 -- Prevented email message line lengths from exceeding the RFC5322 limit. #6469

Merged
merged 1 commit into from
Apr 19, 2016

Conversation

claudep
Copy link
Member

@claudep claudep commented Apr 17, 2016

No description provided.

@@ -169,7 +171,10 @@ def __init__(self, _text, _subtype='plain', _charset=None):
# We do it manually and trigger re-encoding of the payload.
MIMEText.__init__(self, _text, _subtype, None)
del self['Content-Transfer-Encoding']
self.set_payload(_text, utf8_charset)
has_long_lines = any(len(l) > 998 for l in _text.splitlines())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe a module constant could make this slightly more readable? e.g. RFC5322_EMAIL_LINE_LENGTH_LIMIT = 998

@timgraham timgraham changed the title Fixed #22561 -- Prevented too long lines in email messages Fixed #22561 -- Prevented email message line lengths from exceeding the RFC5322 limit. Apr 18, 2016
Thanks NotSqrt for the excellent report and Tim Graham for the review.
@claudep claudep merged commit 836d475 into django:master Apr 19, 2016
@claudep claudep deleted the 22561 branch April 19, 2016 07:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants