Subject: | rfc822 attachement mishandling |
When the message has a message/rfc822 part (e.g. when inspecting a
bounced email), the Summary for that part is a bit of a mess.
For starters, is_message() does not return true as documented. This is
because $part->{type} and $part->{subtype} were clobbered by the type
and subtype of the email.
I currently apply the following patch to your module:
_parse_bodystructure:
if ($self->is_message && $struct->[7] && $struct->[8]) {
# continue parsing attached message
- $self->_parse_envelope($struct->[7]);
- $self->_parse_bodystructure($struct->[8]);
+ $self->{message} = __PACKAGE__->new({
+ ENVELOPE => $struct->[7],
+ BODYSTRUCTURE => $struct->[8],
+ });
} elsif ($self->type ne 'text') {
_parse_body:
if ($self->is_message && $struct->[7] && $struct->[8]) {
# continue parsing attached message
- $self->_parse_envelope($struct->[7]);
- $self->_parse_body($struct->[8]);
+ $self->{message} = __PACKAGE__->new({
+ ENVELOPE => $struct->[7],
+ BODY => $struct->[8],
+ });
}
And added:
sub message { $_[0]->{message} }