Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can't get message/delivery-status part content from Message

896854Oct 30 2011 — edited Nov 1 2011
I'm trying to read a DSN message from a mailbox (with IMAP).

Although I can get the "text/plain" and the original message part, I get a "java.io.IOException: No content" when trying to get the "message/delivery-status" part.

When I check the email source code, I can see that there are contents in the "message/delivery-status" part.

Trying to create a DeliveryStatus object using the MimeBodyPart input stream also throws the following execption:

javax.mail.MessagingException: Error in input stream;
nested exception is:
java.io.IOException: No content

Is there a way to get the "delivery-status" part content and parse it or creat a DeliveryStatus object from it?

Message looks like this:

MIME-Version: 1.0
Content-Type: multipart/report;boundary="_===2030706====smtp.mailserver.com===_";
report-type="delivery-status"


--_===2030706====smtp.mailserver.com===_
Content-Type: text/plain;charset="utf-8"

Failed to deliver to 'bounedemail@email.com'
SMTP module(domain email.com) reports:
email.com: no response


--_===2030706====smtp.mailserver.com===_
Content-Type: message/delivery-status

Reporting-MTA: dns; smtp.mailserver.com

Original-Recipient: rfc822;<bounedemail@email.com>
Final-Recipient: rfc822;<bounedemail@email.com>
Action: failed
Status: 4.0.0

--_===2030706====smtp.mailserver.com===_
Content-Type: text/rfc822-headers

Received: from [XXX.XXX.XXX.XXX] (HELO smtp.mailserver.com)
by smtp.mailserver.com (CommuniGate Pro SMTP 5.3.13 community)
with ESMTPS id 1982792 for bounedemail@email.com; Wed, 26 Oct 2011 06:17:37 -0400
Date: Wed, 26 Oct 2011 06:17:25 -0400 (EDT)
From: "me@gmail.Com" <me@gmail.com>
To: bounedemail@email.com
Message-ID: <557901950.374233.1319624256971.JavaMail.info@sun.com>
Subject: Email Subject!
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_Part_374232_2068297477.1319624256967"
X-FTS-Received-At: Wed Oct 26 06:17:31 EDT 2011

_===2030706====smtp.mailserver.com===_

Edited by: 893851 on Oct 30, 2011 5:58 AM
This post has been answered by Bill Shannon-Oracle on Nov 1 2011
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 29 2011
Added on Oct 30 2011
4 comments
2,062 views