Open falco467 opened 1 year ago
hi @falco467 maybe we should add a strict
(or loose
) mode to trim subjects longer than 76 chars. im leaving this issue open to see how it goes.
As far as I can see, all compliant clients will perform the line break after 76 characters. And I haven't seen any email client in the wild which doesn't parse the soft line breaks correctly. I don't think you necessarily need a "loose" mode to recreate the broken non-standard-compliant behavior.
According to RFC 2047 an encoded word cannot be longer than 76 characters (including everything). So a longer subject line should be split and encoded into multiple encoded words.
Using the library
mgs.setSubject('x'.repeat(100))
results in a single standard breaking encoded word. This leads to some Mail-Servers rejecting this message with an error.The encoding should split and wrap longer encoded words to match the standard.