weismat has asked for the wisdom of the Perl Monks concerning the following question:

I have tried to use Mail::POP3Client together with Email::MIME::Attachment::Stripper to download and ftp attachments from mails via Perl automatically. Based on the documentation this looks rather straight, but I have not managed to get it to work. The main part of my code looks the following way:
use strict; use Mail::POP3Client; use Email::MIME; use Email::MIME::Attachment::Stripper; my $pop = new Mail::POP3Client( USER => 'xxx', PASSWORD => "xxx", HOST => "pop.googlemail.com", USESSL => 'true', ); print "Status: ". $pop->State()." No of email:". $pop->Count(); if ($pop->Count()) { my $mail=$pop->HeadAndBody(1); my $parsed = Email::MIME->new($mail);# my $stripper = Email::MIME::Attachment::Stripper->new($parsed); my @attachments = $stripper->attachments; print;# used to be able to check @attachments in the debugger } $pop->Close(); exit;
Could you point me into a direction where things go wrong? I am currently using Mail::POP3Client because I need SSL. One further requirement is that I need to be able to detach large (>10MB) attachments, but currently I do not manage to get it to work with very small attachments. Thanks for your help! I have solved my problem using MIME::Parser - this works easily according to the documentation. Thanks anyway...
  • Comment on Problems using Mail::POP3Client together with Email::MIME::Attachment::Stripper
  • Download Code

Replies are listed 'Best First'.
Re: Problems using Mail::POP3Client together with Email::MIME::Attachment::Stripper
by Anonymous Monk on Mar 21, 2008 at 10:40 UTC
    Can you post or email your final solution. I need to do exactly what your trying to do. khh7112@gmail.com
      Ditto. I plowed this field all day long. I could not even get the module's test scripts to run. They error out when called to actually strip the attachments.