7// NeedsQuotedPrintable returns whether text, with crlf-separated lines, should be
 
8// encoded with quoted-printable, based on line lengths and any bare carriage
 
9// return or bare newline. If not, it can be included as 7bit or 8bit encoding in a
 
11func NeedsQuotedPrintable(text string) bool {
 
13	for _, line := range strings.Split(text, "\r\n") {
 
14		// 78 should be fine too, qp itself has a requirement of 76 bytes on a line, but
 
15		// using qp for anything longer than 76 is safer.
 
16		if len(line) > 76 || strings.Contains(line, "\r") || strings.Contains(line, "\n") {