浏览代码

Decode quoted-printable in a single part message (#111)

Co-authored-by: hala alajlan <halalajlan@gmail.com>
halaalajlan 5 年之前
父节点
当前提交
4030fe00af
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      email.go

+ 4 - 0
email.go

@@ -223,6 +223,10 @@ func parseMIMEParts(hs textproto.MIMEHeader, b io.Reader) ([]*part, error) {
 		}
 	} else {
 		// If it is not a multipart email, parse the body content as a single "part"
+		if hs.Get("Content-Transfer-Encoding") == "quoted-printable" {
+			b = quotedprintable.NewReader(b)
+
+		}
 		var buf bytes.Buffer
 		if _, err := io.Copy(&buf, b); err != nil {
 			return ps, err