From c4d9ade58602e1599b279f12e1d851f4f28fce72 Mon Sep 17 00:00:00 2001 From: "Adam D. Ruppe" Date: Fri, 17 Feb 2017 12:52:33 -0500 Subject: [PATCH] ketmar base64 encoded body --- email.d | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/email.d b/email.d index 887191c..258c0ee 100644 --- a/email.d +++ b/email.d @@ -699,6 +699,15 @@ class IncomingEmailMessage { if(htmlMessageBody.length) htmlMessageBody = convertToUtf8Lossy(decodeQuotedPrintable(htmlMessageBody), charset); break; + case "base64": + if(textMessageBody.length) { + // alas, phobos' base64 decoder cannot accept ranges, so we have to allocate here + char[] mmb; + mmb.reserve(textMessageBody.length); + foreach (char ch; textMessageBody) if (ch > ' ' && ch < 127) mmb ~= ch; + textMessageBody = convertToUtf8Lossy(Base64.decode(mmb), charset); + } + break; default: // nothing needed }