Subject: | Reading from file descriptor and from array broken |
Hi, this is my very first CPAN bug report.
I'm using Test::Email to verify contents of a sent email received and
saved aside locally via Net::Server::Mail::SMTP; since Test::Email is
based on MIME::Entity which is in turn based on Mail::Internet to read
the mail data, in theory and according to its manual it is possible to
either pass in a file descriptor or a two-item array from which the mail
header and body would get read.
Trying to do so however I get:
you cannot use body() to set the encoded contents
at t/mail.t line 86
Which gets croak'ed from `sub body` in MIME::Entity which is indeed not
designed to set the body; Mail::Internet however provides its own `sub
body` which does not get called since Mime::Entity uses:
my $self = $class->Mail::Internet::new(@_);
in its constructor while Mail::Internet::new does:
my $call = shift;
(...)
my $class = ref($call) || $call;
my $self = bless {}, $class;
so I guess MIME::Entity's methods have precedence where they shouldn't.
I'm not sure whether this is really a bug for the maintainers of
MIME::Entity or Mail::Internet but since the behavior gets triggered by
Test::Email you have the honor to forward and/or work around this
accordingly :)
Additional Information
======================
$(uname -a): Linux XXX 2.6.29.4-167.fc11.x86_64 #1 SMP Wed May 27
17:27:08 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux (i.e. Fedora 11 x86_64)
$(perl -v): This is perl, v5.10.0 built for x86_64-linux-thread-multi
$(rpm -q --whatprovides perl\({Test::Email,MIME::Entity,Mail::Internet}\)):
perl-Test-Email-0.04-2.fc11.noarch
perl-MIME-tools-5.427-2.fc11.noarch
perl-MailTools-2.04-2.fc11.noarch
Thanks for any help.