Bläddra i källkod

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

Co-authored-by: hala alajlan <halalajlan@gmail.com>
halaalajlan 5 år sedan
förälder
incheckning
4030fe00af
1 ändrade filer med 4 tillägg och 0 borttagningar
  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