From b3db232ecc53120f15bd1202ecab2fc826872f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=83=A1=E6=9D=83=E7=85=9C?= <569464708@qq.com> Date: Mon, 26 Feb 2024 20:01:41 +0800 Subject: [PATCH] Update MessagePart.cs --- OpenPop/Mime/MessagePart.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/OpenPop/Mime/MessagePart.cs b/OpenPop/Mime/MessagePart.cs index 78c480f..52fe21a 100644 --- a/OpenPop/Mime/MessagePart.cs +++ b/OpenPop/Mime/MessagePart.cs @@ -486,7 +486,14 @@ private static byte[] DecodeBody(byte[] messageBody, ContentTransferEncoding con case ContentTransferEncoding.Base64: // If encoded in Base64, everything in the body is in US-ASCII - return Base64.Decode(Encoding.ASCII.GetString(messageBody)); + try + { + return Base64.Decode(Encoding.ASCII.GetString(messageBody)); + } + catch + { + return messageBody; + } case ContentTransferEncoding.SevenBit: case ContentTransferEncoding.Binary: @@ -545,4 +552,4 @@ public void Save(Stream messageStream) } #endregion } -} \ No newline at end of file +}