Email::Store::Attachment - my losing battle

Chisel Wright chisel at herlpacker.co.uk
Wed Nov 29 12:58:49 GMT 2006


I've started playing with email store - it's quite magical, and for the
most part seems to be Doing The Right Thing.

Well that's until we get to emails with attachments - it's just not
playing nice at all.

I was hoping that someone had seen this before, or might know what I'm
doing wrong.

I have a script 'error_store_2':

  use Email::Store 'dbi:Pg:dbname=ctracker';
  use Email::Store::Attachment;
  use File::Slurp;

  my $text = read_file( \*STDIN );
  Email::Store::Mail->store( $text ) or die $!;

I've got the source of an email I've sent to myself, with a small jpg
attachment.

When run, the script dies with an error:

---- cut here ----
$ validate_utf8 test_email_attached_jpg.eml 
test_email_attached_jpg.eml: valid UTF-8 (ascii)

$ cat test_email_attached_jpg.eml |./email_store_2 
Entity: evil_chisel.jpg at
/usr/local/share/perl/5.8.8/Email/Store/Attachment.pm line 28.
Can't insert new Email::Store::Attachment: DBD::Pg::st execute failed:
ERROR:  invalid byte sequence for encoding "UTF8": 0xff
 [for Statement "INSERT INTO attachment (content_type, filename,
payload, id, mail)
VALUES (?, ?, ?, ?, ?)
" with ParamValues: 4='10', 1='image/jpeg', 3='.�.�',
2='evil_chisel.jpg', 5='20061129125014.GD7541 at herlpacker.co.uk'] at
/usr/share/perl5/DBIx/ContextualFetch.pm line 52.
 at /usr/local/share/perl/5.8.8/Module/Pluggable/Ordered.pm line 51
---- cut here ----

I can make the email available message if required.

Chisel
-- 
Chisel Wright
e: chisel at herlpacker.co.uk
w: http://www.herlpacker.co.uk/

  I wrote a todo list; Now I can procrastinate more efficiently!


More information about the london.pm mailing list