in reply to Re^5: mail attachment extraction
in thread mail attachment extraction

Really ! So something must be wrong with me... Using Attachment::Stripper directly fails on : "Need a message"... I updated the code on this page, as you can see I followed your recommandation. Of course, I tried "$stripper = Email::MIME::Attachment::Stripper->new($MsgTxt);" many times.

Replies are listed 'Best First'.
Re^7: mail attachment extraction
by Krambambuli (Curate) on May 06, 2007 at 17:47 UTC
    Well... Here is the code that works for me, I've just changed the auth data for me to work and have now commented out everything I think is irrelevant:

    As said, this works for me. Might be that we have different version of Email::MIME::Attachment::Stripper; what I have is version 1.313, Perl 5.8.8.
      Thank you for giving this code, but there is something definitely weired... I pasted your code as it is and it always complain with "Need a message..." I use the same version of perl and Attachment::stripper as you...
        Hmmmm... Are you sure you actually get a message out of your Inbox, so that $MsgTxt isn't empty ?

        Just insert
        print Dumper( $MsgTxt );
        where that assignment is and you should know. I've noticed you're always looking fo the newest unseen message - maybe you just have run out of 'amunition' and there is no more unseen message to cope with?

        Maybe it's better to search an message that you know for sure that exists and retrieve it during testing via uid, like
        my $MsgId = $imap->search('uid', '257283')->[0];