Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Email-Abstract CPAN distribution.

Report information
The Basics
Id: 77624
Status: resolved
Priority: 0/
Queue: Email-Abstract

People
Owner: Nobody in particular
Requestors: bailey [...] mail.newman.upenn.edu
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 3.004



When the wrapped message is a MIME::Entity containing a multipart message, Email::Abstract's get_body() blows up, since MIME::Entity does not provide a bodyhandle for this type of message, so the following call to as_string gives Perl heartburn. This seems to involve something of a policy question, so rather than supply a bunch of patches, I can raise some possibilities: 1. Take an inclusive view of "body", and (perhaps only for a multipart message) return the encoded body for a MIME::Entity via something like sub get_body { my $obj = shift; my $handle = $obj->bodyhandle; join('', $self->body); This is nice for the abstraction (especially if it follows what currently happens to a Mail::Message::Multipart - haven't tested), but gives "body" a different meaning than MIME::Entity. 2. Take MIME::Entity's view of "body", and
Subject: Exception on get_body() for multipart MIME::Entity
[ Loathe hotkeys . . . ] When the wrapped message is a MIME::Entity containing a multipart message, Email::Abstract's get_body() blows up, since MIME::Entity does not provide a bodyhandle for this type of message, so the following call to as_string gives Perl heartburn. This seems to involve something of a policy question, so rather than supply a bunch of patches, I can raise some possibilities: 1. Take an inclusive view of "body", and (perhaps only for a multipart message) return the encoded body for a MIME::Entity via something like sub get_body { my $obj = shift; my $handle = $obj->bodyhandle; return $handle ? $handle->as_string : join('', $self->body); } This is nice for the abstraction (especially if it follows what currently happens to a Mail::Message::Multipart - haven't tested), but gives "body" a different meaning than MIME::Entity. 2. Take MIME::Entity's view of "body", and return nothing for a multipart message, something like sub get_body { my $obj = shift; my $handle = $obj->bodyhandle; return $handle ? $handle->as_string : undef; } This is more faithful to what a seasoned MIME::Entity user might expect, but seems IMHO to cut against the grain of Email::Abstract's abstraction. But it at least avoids the exception in the current version.
Thanks! I've fixed this in git and will make a release in the next few hours. -- rjbs