[prev] [thread] [next] [lurker] [Date index for 2005/02/17]
Author: richardc
Date: 2005-02-17 17:02:31 +0000 (Thu, 17 Feb 2005)
New Revision: 1904
Modified:
trunk/Email-Store/lib/Email/Store/Attachment.pm
Log:
it's ->bodyhandle->as_string to get at the decoded attachment body
Modified: trunk/Email-Store/lib/Email/Store/Attachment.pm
===================================================================
--- trunk/Email-Store/lib/Email/Store/Attachment.pm 2005-02-17 16:49:42 UTC (rev 1903)
+++ trunk/Email-Store/lib/Email/Store/Attachment.pm 2005-02-17 17:02:31 UTC (rev 1904)
@@ -3,7 +3,7 @@
use strict;
use MIME::Parser;
__PACKAGE__->table("attachment");
-__PACKAGE__->columns(All => qw[id mail filename content_type payload ]);
+__PACKAGE__->columns(All => qw[ id mail filename content_type payload ]);
__PACKAGE__->has_a(mail => "Email::Store::Mail");
Email::Store::Mail->has_many(attachments => "Email::Store::Attachment");
@@ -14,10 +14,10 @@
my $id = $mail->message_id;
my $rfc822 = $mail->message;
my $parser = MIME::Parser->new();
-
+
$parser->output_to_core('ALL');
$parser->extract_nested_messages(0);
-
+
my $entity = $parser->parse_data($rfc822);
my @keep;
@@ -25,7 +25,7 @@
push (@keep, $_) && next if keep_part($_);
my $type = $_->effective_type;
my $file = $_->head->recommended_filename() || invent_filename($type);
- my $payload = $_->body_as_string;
+ my $payload = $_->bodyhandle->as_string;
$class->create({ mail => $id, payload => $payload, content_type => $type, filename => $file });
}
$entity->parts(\@keep);
Generated at 18:00 on 17 Feb 2005 by mariachi 0.52