CC: | cpan [...] herlpacker.co.uk |
Subject: | Can't call method "as_string" on an undefined value at lib/Email/Store/Attachment.pm |
I think there's a problem with nested mime (eg multipart/alternative +
image/jpeg) formatted emails.
I don't properly understand the problem (yet), but it looks like some
email messages get constructed as two entities, the first being a
holding entity for the multipart/alternative message, e.g.:
/
|-- multipart/alternative
|-- text/plain
|-- text/html
|-- image/jpeg
The first entity doesn't have a bodyhandle(), causing the reported error
message.
Subject: | 60.nested.mime.t |
use strict;
use warnings;
use Test::More tests => 2;
use File::Slurp;
BEGIN { unlink("t/test.db"); }
use Email::Store { only => [qw( Mail Attachment )] },
("dbi:SQLite:dbname=t/test.db", "", "", { sqlite_handle_binary_nulls => 1 } );
Email::Store->setup;
ok(1, "Set up");
my $data = read_file("t/nested-mime");
my $mail = Email::Store::Mail->store($data);
my @att = $mail->attachments;
is (@att, 2, "Has two attachments");
Subject: | nested-mime |
Message body not shown because it is not plain text.