Note: There are other documents, specifically the MIME documents
(RFC 2045, RFC 2046, RFC 2049, RFC 4288, RFC 4289),
that extend (and limit) this specification to allow for different sorts of message bodies.
foldLine( 'Subject: from x.y.test by example.net via TCP with ESMTP id ABC12345 for <mary@example.net>', 30 )
'Subject: from x.y.test by \r\n' + ' example.net via TCP with \r\n' + ' ESMTP id ABC12345 for \r\n' + ' <mary@example.net>'
API
Constants
number foldLine.DEFAULT_LINE_LENGTH = 78
number foldLine.MIN_LINE_LENGTH = 1
number foldLine.MAX_LINE_LENGTH = 998
Methods
foldLine( value[, maxLength[, minLength]] )
string value: String to be folded
number maxLength: Maximum line length (excluding <CRLF>).
Hard line length limit. Any line longer than this will be hard-folded.
Defaults to foldLine.DEFAULT_LINE_LENGTH (78).
number minLength: Minimum line length (excluding <CRLF>).
Lines that would be shorter than this limit when soft-folded will
be hard-folded instead, in order to maintain more consistent line lengths.
Defaults to maxLength / 3.