* Always Q-encode headers exceeding maximum length
Previously, headers exceeding the maximum line length without
any special characters were only folded. This lead to problems
with long filenames (#1469) and long headers in general (#1525).
Now, long headers are always Q-encoded (and still folded).
* Use ASCII as Q-encoding charset if applicable
Previously, headers were Q-encoded using the message
charset, e.g. UTF-8. This is excessive for ASCII
values, as it requires a unicode engine.
Now, we use ASCII if we only find 7-bit characters.
* Separate header encoding from encoding selection
* Use ASCII for B-encoding as well
* Refactor max line length calculation
Previously, we calculated the maximum
line length for header encoding both
for B- and Q-encoding, even though
they share the same limits.
Now, we calculate these once for both.