Add basic base64 decoding for single-part email
j3s j3s@c3f.net
Wed, 20 Nov 2019 17:49:19 -0600
1 files changed,
8 insertions(+),
1 deletions(-)
jump to
M
mail/main.go
→
mail/main.go
@@ -151,7 +151,14 @@ return e, err
} switch { case ct == "text/plain": - e.Text = p.body + body := p.body + if p.header.Get("Content-Transfer-Encoding") == "base64" { + body, err = base64.StdEncoding.DecodeString(string(p.body)) + if err != nil { + return e, err + } + } + e.Text = body case ct == "text/html": e.HTML = p.body }