4
votes

I am having a strange issue parsing some POP3 messages in JavaMail 1.4.4 - Java 1.4, also in Java 1.6.

I am parsing a com.sun.mail.pop3.POP3Message retrieved from a Windows 2003 POP3 service mailbox. When I go through the getAllHeaderLines() Enumeration and compare them to the source message I see that the Reply-To header is cut off in mid email address and all remaining headers are missing (specifically 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 about the message looks normal and matches the source message file when I turn on JavaMail debug mode.

Any ideas would be appreciated.

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

Message-ID: <[email protected]>
Date: Sun, 26 Aug 2012 08:38:52 -0700
From: Secure Comfort <[email protected]>
Reply-To: Secure Comfort <[email protected]>
Subject: Language & Transportation Service 
To: "[email protected]"
    < xxxxxx @ xxxxxx.com>
In-Reply-To: <[email protected]>
MIME-Version: 1.0
Content-Type: multipart/mixed;
    boundary="1816409020-1433069823-1345995533=:54860"
Return-Path: [email protected]
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 most of the getters for the MimeMessage:

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=<[email protected]>
Received Date=null
Sent Date=Sun Aug 26 10:38:52 CDT 2012
Size=7480850
Subject=null
1
I had the same issue and only upgrade to latest javax.mail-api 1.5.3 solved it.user1516873

1 Answers

0
votes

What does the debug output from JavaMail show? (If you don't want to post it here, send it to me at [email protected].)

There's no header size limit in JavaMail.

Possibly you have a firewall or anti-virus software that's intercepting the conversation with the server and (accidentally) introducing this break in the message headers.