Kitura / Swift-SMTP

Swift SMTP client
Apache License 2.0
262 stars 63 forks source link

Line length limit #121

Open t-ae opened 2 years ago

t-ae commented 2 years ago

According to RFC5322:

Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.

If we have multiple to, they are joined to comma separated single line.

https://github.com/Kitura/Swift-SMTP/blob/f9b1d704b196a23787970649922cbb8e29348ea6/Sources/SwiftSMTP/Mail.swift#L125

This can easily violate the 998 characters limit. In my environment, I receive broken mail if there are too many to. (I think the behavior is up to mail server's implementation)