diff --git a/encode.go b/encode.go index bef657b..2dea6ea 100644 --- a/encode.go +++ b/encode.go @@ -5,12 +5,12 @@ import ( "encoding/base64" "io" "mime" - "mime/quotedprintable" "net/textproto" "sort" "strings" "time" + "github.com/huangshaokun/mimequotedprintable" "github.com/jhillyerd/enmime/v2/internal/coding" "github.com/jhillyerd/enmime/v2/internal/stringutil" ) @@ -243,7 +243,7 @@ func (p *Part) encodeContent(b *bufio.Writer, cte transferEncoding) (err error) text = text[lineLen:] } case teQuoted: - qp := quotedprintable.NewWriter(b) + qp := mimequotedprintable.NewWriter(b) if _, err = qp.Write(p.Content); err != nil { return err } diff --git a/go.mod b/go.mod index 56148a6..d3228bb 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/cention-sany/utf7 v0.0.0-20170124080048-26cad61bd60a github.com/go-test/deep v1.1.1 github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f + github.com/huangshaokun/mimequotedprintable v0.0.0-20230626102010-a5b2166f9691 github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.9.0 diff --git a/go.sum b/go.sum index 4cccf3c..30e2035 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U= github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f h1:3BSP1Tbs2djlpprl7wCLuiqMaUh5SJkkzI2gDs+FgLs= github.com/gogs/chardet v0.0.0-20211120154057-b7413eaefb8f/go.mod h1:Pcatq5tYkCW2Q6yrR2VRHlbHpZ/R4/7qyL1TCF7vl14= +github.com/huangshaokun/mimequotedprintable v0.0.0-20230626102010-a5b2166f9691 h1:cMH8l7waIU0+24EihDQBtCfpwdHsvYNaNgOOg2iyAPE= +github.com/huangshaokun/mimequotedprintable v0.0.0-20230626102010-a5b2166f9691/go.mod h1:gDBKZcuLIpRM4uX1/Dv2jLAF+9Fqf5zy0Rg2XzPh+Iw= github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 h1:iCHtR9CQyktQ5+f3dMVZfwD2KWJUgm7M0gdL9NGr8KA= github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= diff --git a/part.go b/part.go index ef39e5f..e8ee0ab 100644 --- a/part.go +++ b/part.go @@ -6,13 +6,13 @@ import ( "encoding/base64" "io" "math/rand" - "mime/quotedprintable" "net/textproto" "strconv" "strings" "time" "github.com/gogs/chardet" + "github.com/huangshaokun/mimequotedprintable" "github.com/jhillyerd/enmime/v2/internal/coding" inttp "github.com/jhillyerd/enmime/v2/internal/textproto" "github.com/jhillyerd/enmime/v2/mediatype" @@ -290,7 +290,7 @@ func (p *Part) decodeContent(r io.Reader, readPartErrorPolicy ReadPartErrorPolic switch strings.ToLower(encoding) { case cteQuotedPrintable: contentReader = coding.NewQPCleaner(contentReader) - contentReader = quotedprintable.NewReader(contentReader) + contentReader = mimequotedprintable.NewReader(contentReader) case cteBase64: b64cleaner = coding.NewBase64Cleaner(contentReader) contentReader = base64.NewDecoder(base64.RawStdEncoding, b64cleaner)