Open rudiedirkx opened 1 year ago
Interesting, never heard about RFC822-HEADERS
before.
Would you like to propose a PR with a fix? It will be very much appreciated :heart:
I was afraid you'd say that =) I'll give it a shot, but there's a lot of package interfaces that have to remain BC, so it's not easy. The RFC822-HEADERS part is a kind of message interface, but without content, but with all the headers, so what interfaces is it..?
I am reading bounces from a sender mailbox to mark some users as undeliverable. To do that I need the bounce
DELIVERY-STATUS
subpart. That's pretty easy:getSubtypePart()
will find the subpart anywhere, andgetDeliveryStatus()
will return its content.But I also want some info from the original mail that was bounced. Some mail servers embed the entire original mail in the bounce, so I can find that attachment part (
Attachment
) and its message (BasicMessageInterface
) with all the original headers:But some mail servers don't include the entire original message (
RFC822
), just the headers (RFC822-HEADERS
):That part is not an
Attachment
part, but aSimplePart
, and that doesn't support an 'embedded message'. Which is true, it's not a full message, but it does contain very useful headers in a standard format. But I can't get at those, because aSimplePart
doesn't think it has headers. I can see them in the raw content (see below), but I can't access them (without parsing the entire raw email, so no).This is a full bounce without RFC822 but with RFC822-HEADERS: