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

I am new to perl, and not having very good luck in my latest attempt to use it. I need to extract an attachment of an email and put it in a directory for another perl program to pick up and process. I have been looking at the MAIL: module, but can't really find anything that will work. I believe that I can use the .forward file to initiate the extracting of the attachment, am I correct? Any help would be appreciated. Thanks

Replies are listed 'Best First'.
Re: Extracting mail attachments
by bart (Canon) on Feb 05, 2003 at 19:55 UTC
    In order to extract attachments, you'd better look at one of the MIME modules. There's the full-blown MIME::Parser module, part of the MIME::Tools package... and looks like a few more candidates: MIME::Fast, MIME::Explode... the latter seems particularily aimed at your type of application:
    MIME::Explode is perl module for parsing and decoding single or multipart MIME messages, and outputting its decoded components to a given directory ie, this module is designed to allows users to extract the attached files out of a MIME encoded email messages or mailboxes.
Re: Extracting mail attachments
by zentara (Cardinal) on Feb 07, 2003 at 15:31 UTC
    If you are a beginner, it may be easier to get existing software to do this. ripMime