ketmar base64 encoded body

This commit is contained in:
Adam D. Ruppe 2017-02-17 12:52:33 -05:00
parent 06e3d82803
commit c4d9ade586
1 changed files with 9 additions and 0 deletions

View File

@ -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
}