使用mime4j解析由Outlook生成的EML文件,有时主体为空,试图了解原因

问题描述

我已经在Outlook Server上为特定电子邮件生成了EML。我有一个Java程序已编写为处理提供的EML / MIME文件并将其解析为它们的不同mime部分。

为此,我使用了MIME4j,效果很好。但是,我遇到了一些电子邮件问题,我无法弄清原因。

以下示例在使用mim4j进行解析时,即使在EML / MIME中似乎有一个正文,也不会返回正文。我不知道为什么,所以我正在寻找有关为什么会发生这种情况的指导

EML文件内容如下:

Received: from Exchange.myserver.com (123.123.123.123) by Exchange.myserver.com
 (123.123.123.123) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via MailBox
 Transport; Sat,12 Sep 2020 12:50:52 -0400
Received: from Exchange.myserver.com (123.123.123.123) by EXCHANGE
 (123.123.123.123) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Sat,12 Sep
 2020 12:50:52 -0400
Received: from web.myserver.com (167.114.53.134) by Exchange.myserver.com
 (123.123.123.123) with Microsoft SMTP Server id 15.0.1395.4 via Frontend
 Transport; Sat,12 Sep 2020 12:50:52 -0400
To: Carl Tyler <ctyler@mydomain.com>
In-Reply-To: <DM6PR13MB398595C5C103A6E7C6F4A478FF250@DM6PR13MB3985.namprd13.prod.outlook.com>
Message-ID: <OF55277810.A6167A71-ON852585E1.005C8A64-1599929447451@myserver.com>
Expiry-Date: (invalid)
Date: Sat,12 Sep 2020 12:50:47 -0400
Subject: Re: Just a quick test
From: Carl Tyler <ctyler@myserver.com>
X-Mailer: Traveler 11.0.1.0 Build 202003261935_30 on server Web/myserver on behalf of
 device with id And...773,type 700 (android) and description Google Pixel
 2 XL:Android 10:IBM Verse/11.0.8.0 202009031338 at 20200912125047513 by DS-143c[gznx+AAA][2]
X-KeepSent: 55277810:A6167A71-852585E1:005C8A64;
 type=4; name=$KeepSent
X-MIMETrack: Itemize by nTRAVELER.EXE on Web/myserver(Release 11.0.1|march 21,2020) at 09/12/2020
 12:50:47 PM,Serialize by Router on Web/myserver(Release 11.0.1|march 21,2020) at 09/12/2020
 12:50:47 PM
Content-Type: multipart/alternative;
    boundary="----=_Part_5_1157233420.1599929447404"
Return-Path: ctyler@myserver.com
X-MS-Exchange-Organization-Network-Message-Id: 391c4592-049c-454d-1712-08d8573c0272
X-MS-Exchange-Organization-AuthSource: Exchange.myserver.com
X-MS-Exchange-Organization-AuthAs: Anonymous
MIME-Version: 1.0

------=_Part_5_1157233420.1599929447404
Content-Type: text/plain; charset="UTF-8"
Content-transfer-encoding: quoted-printable

Thank you it worked=0A=0ACarl=0A=0A=0A   Carl Tyler --- Just a quick test -=
-- =0A    From:"Carl Tyler" <ctyler@mydomain.com>To:ctyler@myserver.comDate:S=
at,Sep 12,2020 12:49 PMSubject:Just a quick test=0A  =0A   =0A    Test123=
=0A  =0A  =0A      =0A   Get Outlook for Android=0A  =0A
------=_Part_5_1157233420.1599929447404
Content-Type: text/html; charset="UTF-8"
Content-transfer-encoding: quoted-printable

<html>
<head>
<Meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8"></=
head>
<body><font style=3D"white-space:pre-wrap;font-family: Helvetica Neue,Helv=
etica,Arial,sans-serif;margin: 1em 0;">Thank you it worked<br><br>Carl</f=
ont><br><br><div class=3D"domino-section" dir=3D"ltr"><div class=3D"domino-=
section-head"><span class=3D"domino-section-title"><font color=3D"#424282">=
Carl Tyler --- Just a quick test --- </font></span></div><div class=3D"domi=
no-section-body"><br><table width=3D"100%" border=3D"0" cellspacing=3D"0" c=
ellpadding=3D"0"><tr valign=3D"top"><td width=3D"1%" style=3D"width: 96px;"=
><font size=3D"2" color=3D"#5F5F5F">From:</font></td><td width=3D"100%" sty=
le=3D"width: auto;"><font size=3D"2">&quot;Carl Tyler&quot; &lt;ctyler@impe=
ople.com&gt;</font></td></tr><tr valign=3D"top"><td width=3D"1%" style=3D"w=
idth: 96px;"><font size=3D"2" color=3D"#5F5F5F">To:</font></td><td width=3D=
"100%" style=3D"width: auto;"><font size=3D"2">ctyler@myserver.com</font></td=
></tr><tr valign=3D"top"><td width=3D"1%" style=3D"width: 96px;"><font size=
=3D"2" color=3D"#5F5F5F">Date:</font></td><td width=3D"100%" style=3D"width=
: auto;"><font size=3D"2">Sat,2020 12:49 PM</font></td></tr><tr va=
lign=3D"top"><td width=3D"1%" style=3D"width: 96px;"><font size=3D"2" color=
=3D"#5F5F5F">Subject:</font></td><td width=3D"100%" style=3D"width: auto;">=
<font size=3D"2">Just a quick test</font></td></tr></table><hr width=3D"100=
%" size=3D"2" align=3D"left" noshade=3D"" style=3D"color:#8091A5; "><br></d=
iv><html>
<head>

</head>
<body>
<div style=3D"color: rgb(33,33,33); background-color: rgb(255,255,255);=
 text-align: left;" dir=3D"auto">
Test123</div>
<div id=3D"ms-outlook-mobile-signature">
<div><br>
</div>
Get <a href=3D"https://aka.ms/ghei36">Outlook for Android</a></div>
</body>
</html>
</body></html>=

------=_Part_5_1157233420.1599929447404--

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)