JavaMail loses some POP3 message headers and treats multipart / mixed as text / plain

I had a strange problem parsing some POP3 messages in JavaMail 1.4.4 - Java 1.4, also in Java 1.6.

I am parsing com.sun.mail.pop3.POP3Message extracted from the Windows 2003 POP3 service mailbox. When I go through getAllHeaderLines() Enumeration and compare them with the original message, I see that the Reply-To header is disabled in the middle of the email address , and all other headers are missing (in particular, Subject, To, In-Reply-To, MIME-Version, Contact-Type, Return-Path, and X-OriginalArrivalTime). The getContentType() method returns text / plain, and the getContent() method returns the entire multipart / mixed message as a string.

Everything regarding the message looks fine and matches the original message file when I turn on JavaMail debugging mode.

Any ideas would be appreciated.

Here is a snippet of the source message file in the POP3 mailbox:

 Message-ID: < 1345995532.54860.YahooMailNeo@web111910.mail.gq1.yahoo.com > Date: Sun, 26 Aug 2012 08:38:52 -0700 From: Secure Comfort < securecomforttransportation@ymail.com > Reply-To: Secure Comfort < securecomforttransportation@ymail.com > Subject: Language & Transportation Service To: " xxxxxx@xxxxxx.com " < xxxxxx @ xxxxxx.com> In-Reply-To: < 1345995390.53486.YahooMailNeo@web111908.mail.gq1.yahoo.com > MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1816409020-1433069823-1345995533=:54860" Return-Path: securecomforttransportation@ymail.com X-OriginalArrivalTime: 26 Aug 2012 15:39:22.0287 (UTC) FILETIME=[F6D67BF0:01CD83A0] --1816409020-1433069823-1345995533=:54860 Content-Type: multipart/alternative; boundary="1816409020-520494517-1345995533=:54860" --1816409020-520494517-1345995533=:54860 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable 

Here are the most MimeMessage recipients:

 Content ID=null Content Language=null Content MD5=null Content Type=text/plain Data Handler=javax.mail.internet.MimeBodyPart$MimePartDataHandler Description=null Disposition=null Encoding=null File Name=null Line Count=-1 Message ID=< 1345995532.54860.YahooMailNeo@web111910.mail.gq1.yahoo.com > Received Date=null Sent Date=Sun Aug 26 10:38:52 CDT 2012 Size=7480850 Subject=null 
+4
source share
1 answer

What outputs debug output from JavaMail? (If you do not want to publish it here, send it to me at javamail_ww@oracle.com. )

JavaMail has no header size limit.

Perhaps you have a firewall or antivirus software that intercepts a conversation with the server and (by accident) represents this gap in the message headers.

0
source

All Articles