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

Sorry but I am still trying and can't get to anywhere... I definitely can't give $MsgTxt to Attachment::stripper, because it needs an Email::Mime object. The parsing does not go well with Email::Mime : it is all messed up. Somehow I can't get IMAP::Talk to give me something in the proper format, but this is beyond my understanding... I am really exhausted, I have been 2 weeks on that :(

Replies are listed 'Best First'.
Re^5: mail attachment extraction
by Krambambuli (Curate) on May 06, 2007 at 17:11 UTC
    I'm not sure what exactly it is what you're stumbling over.

    I have tested the code I've submitted and it works quite well.

    Just instantiate Email::MIME::Attachment::Stripper using the full text mail, as I mentioned previously and it just works as expected. Did you try it ?

    Outcomment all code you have in your original program between the assignment to $MsgTxt and the instantiation of the stripper.

    I'll add the full code if you think it's necessary, but there is really nothing else there than getting rid of the superfluous codelines.

      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.
        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.