small pixel drawing of a pufferfish clist

Add basic base64 decoding for single-part email
j3s j3s@c3f.net
Wed, 20 Nov 2019 17:49:19 -0600
commit

eab7f8b1fea472b44402f4390fa95942fb267a9f

parent

ba6559b4676c9e4e831f0950ee8a5859248bad2a

1 files changed, 8 insertions(+), 1 deletions(-)

jump to
M mail/main.gomail/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 }