Commit f85cf21c authored by Christian Schoenebeck's avatar Christian Schoenebeck Committed by Sandro Knauß
Browse files

Fix MIME headers from exceeding permitted line length

Automatically break a header of outbound MIME content over
multiple lines if needed by calling foldHeader() on each header.

So far outbound MIME content was always assembled with each header
spanning exactly one line, independent of the actual amount of
characters in each header and even if the original inbound content
already had headers correctly folded. This easily caused headers to
exceed the mandatory maximum line length limit of 998 characters as
mandated by RFC 5322 section 2.1.1. "Line Length Limits", which in
turn caused e.g. emails being bounced by many SMTP servers.
parent a35fe822
......@@ -199,7 +199,7 @@ QByteArray Content::assembleHeaders()
QByteArray newHead;
for (const Headers::Base *h : std::as_const(d->headers)) {
if (!h->isEmpty()) {
newHead += h->as7BitString() + '\n';
newHead += foldHeader(h->as7BitString()) + '\n';
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment