mirror of
https://github.com/mjl-/mox.git
synced 2024-12-27 08:53:48 +03:00
18 lines
425 B
Go
18 lines
425 B
Go
|
package message
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
// NeedsQuotedPrintable returns whether text should be encoded with
|
||
|
// quoted-printable. If not, it can be included as 7bit or 8bit encoding.
|
||
|
func NeedsQuotedPrintable(text string) bool {
|
||
|
// ../rfc/2045:1025
|
||
|
for _, line := range strings.Split(text, "\r\n") {
|
||
|
if len(line) > 78 || strings.Contains(line, "\r") || strings.Contains(line, "\n") {
|
||
|
return true
|
||
|
}
|
||
|
}
|
||
|
return false
|
||
|
}
|