katzenpost / mailproxy

POP/SMTP to Katzenpost proxy server library
GNU Affero General Public License v3.0
4 stars 5 forks source link

recv: Ensure all lines in the message body are not oversized. #6

Closed Yawning closed 6 years ago

Yawning commented 6 years ago

When re-serializing messages for storage, the Line Length Limits (as specified in RFC 5322) should be enforced.

There are two limits that this specification places on the number of
characters in a line.  Each line of characters MUST be no more than
998 characters, and SHOULD be no more than 78 characters, excluding
the CRLF.
Yawning commented 6 years ago

I'm not sure how strictly this should be applied, I'll need to think about this some more.

Bad things will happen currently when lines hit the 64 KiB mark, so something certainly should be changed there to not cause problems, but apart from that I'm uncertain.