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!

Delivery status & disposition notification parsing problem

Hamit HasanhocaogluApr 18 2012 — edited May 8 2012
Hi everybody;

I'am trying to parse DSN and MDN messages using dsn.jar (using version 1.4.5 maven artifact). It is in my classpath and everything is fine until i try to get report fields. Reading the source and debugging; it seems that both DispostionNotification and DeliveryStatus classes parse "headers" and "fields" of the report body part (2. part in a multipart report) incorrectly. For example when fetching an MDN similar to the following (which is the sample MDN from RFC-3798):

Content-Type: multipart/report; report-type=disposition-notification;
boundary="RAA14128.773615765/example.com"

--RAA14128.773615765/example.com

[human readable part]

--RAA14128.773615765/example.com
content-type: message/disposition-notification // part header ?

Reporting-UA: joes-pc.cs.example.com; Foomail 97.1 // report fields ?
Original-Recipient: rfc822;Joe_Recipient@example.com
Final-Recipient: rfc822;Joe_Recipient@example.com
Original-Message-ID: <199509192301.23456@example.org>
Disposition: manual-action/MDN-sent-manually; displayed

DispositionNotification class uses InternetHeaders to parse notifications and i get a single field: content-type: message/disposition-notification (which is a header of the part) instead of 5. InternetHeaders stops parsing when it see the new line after the content-type header and fields are not parsed. I was expecting that "headers" of the report body part must be skipped before parsing report fields. Same issue applies to the DeliveryStatus and messageDSN, per-recipientDSNs fields seems to be incorrectly parsed.

Am i doing something wrong or is there a way to make Report classes skip body part headers before parsing fields ?

Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2012
Added on Apr 18 2012
2 comments
1,752 views