Failed to get content of message/delivery-status of Message part

I'm reading a message DSN to a box (with IMAP) mailbox.

Although I can get the "text/plain" and the part of the original post, I get an "java.io.IOException: no content" in trying to get the part "message/delivery-status".

When I check the source code of the e-mail, I see that it is contained in the section "message/delivery-status".

Trying to create a DeliveryStatus object using the flow entered MimeBodyPart also raises the following execption:

javax.mail.MessagingException: error in the input stream;
nested exception is:
java.io.IOException: no content

Is there a way to get the content of the "delivery-status" framework and analyze it or create an object DeliveryStatus of her?

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".

Could not deliver to "[email protected]".
SMTP module reports (domain email.com):
email.com: no response


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

Reporting-MTA: dns; SMTP. MailServer.com

Original-recipient: rfc822; < [email protected] >
Final-recipient: rfc822; < [email protected] >
Action: failure
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 the 1982792 ESMTPS id for [email protected]; Wednesday, October 26, 2011 06:17:37-0400
Date: Wednesday, October 26, 2011 06:17:25-0400 (EDT)
' From: ' me@gmail. Com"< [email protected] >
To: [email protected]
Message-ID: < [email protected] >
Subject: Subject of e-mail!
MIME-Version: 1.0
Content-Type: multipart/alternative;
Boundary = ""-_Part_374232_2068297477.1319624256967 = ""
X FTS-receipt-to: Wed Sep 26 06:17:31 EDT 2011

_ = 2030706 = SMTP.MailServer.com = _

Published by: 893851 on October 30, 2011 05:58

As I suspected, it's a bug in your mail server. Please report it to the seller.

Here's the bug:

A9 FETCH 1 (BODY [2]<0.195>)
* 1 FETCH (BODY [2]<0> NILE)

Instead of responding with the content of this part of the body, the server returns ZERO.

The JavaMail FAQ shows how to work around bugs like this in the IMAP servers.

Tags: Java

Similar Questions

Maybe you are looking for