Skip Menu |

This queue is for tickets about the Net-IMAP-Client CPAN distribution.

Report information
The Basics
Id: 56647
Status: resolved
Priority: 0/
Queue: Net-IMAP-Client

People
Owner: Nobody in particular
Requestors: IKEGAMI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.93
Fixed in: 0.94



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} }
On Thu Apr 15 19:58:19 2010, ikegami wrote: Show quoted text
> 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} }
Hi Ikegami! The original author, Mihai Bazon, has deputized me as primary maintainer for this distribution. I've applied your patches, also uploaded to github bolangi/Net-IMAP-Client. Hope to do a release sometime soon. One problem is that there aren't many tests, so not much of a safety net if I do something stupid. If you're using this distribution, I'll appreciate any suggestions you can offer to help improve things. Regards, Joel
I have applied the patch in release 0.94. As the submitter used the code successfully, I am marking the bug 'resolved'. Would welcome any further reports.