Delivery status & disposition notification parsing problem
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.