nullmailer icon indicating copy to clipboard operation
nullmailer copied to clipboard

nullmailer sends non-RFC compliant messages (lines longer than 998 characters)

Open mricon opened this issue 1 year ago • 0 comments

Per RFC-2822, lines MUST NOT be longer than 998 characters:

2.1.1. Line Length Limits

There are two limits that this standard 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.

https://datatracker.ietf.org/doc/html/rfc2822#section-2.1.1

It appears that nullmailer will always unwrap To/Cc headers and re-concatenate them into a single long line even if this results in a header longer than 998 characters. Such messages will either be rejected by some mail servers (e.g. Exim), while others will force-insert <CR><LF><SPACE> at character 998 regardless of header content (e.g. Postfix, Sendmail).

When generating To/Cc headers, nullmailer should ensure that the line is not longer than 998 characters. If it is, make_recipient_list() should properly insert <CR><LF><SPACE> before continuing to add more recipients:

https://github.com/bruceg/nullmailer/blob/master/src/inject.cc#L384

mricon avatar Jan 09 '24 22:01 mricon