Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Forwarding emails from my Unix Mailbox

by pr (Initiate)
on Sep 23, 2002 at 03:32 UTC ( [id://199994]=perlquestion: print w/replies, xml ) Need Help??

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

Hi,
I am using a perl script to extract details of incoming mails to my Unix mailbox (MBOX).

For some mails with attachments, I need to forward them with the attachements and some extra "forwarding text" added to the body of the email.

I have had a look at various packages, include MIME and Mail::Box. But when I try a reply I dont get the body of the original mail. There are no pointers to forwarding emails.

Are there any packages which I can use, or is there some sample snippets/sites which would help me with this.

Thanks in advance.

Replies are listed 'Best First'.
Re: Forwarding emails from my Unix Mailbox
by PodMaster (Abbot) on Sep 23, 2002 at 08:41 UTC
    Try Mail::MboxParser for reading mailboxes.

    I doubt there would be any pointers on forwading emails, since all forwarding email is, is just sending email, and there's plenty of pointers on that.

    What do you mean when you say "But when I try a reply I dont get the body of the original mail."?

    ____________________________________________________
    ** The Third rule of perl club is a statement of fact: pod is sexy.

Re: Forwarding emails from my Unix Mailbox
by jlongino (Parson) on Sep 23, 2002 at 14:55 UTC
    Although there might be something more straight forward, you might want to explore MIME::Entity. It is probably the best (but most detailed/involved way) to analyze/manipulate a message with attachments. The tricky part is determining whether or not you even have a message body text. As podmaster points out, you can use Mail::MboxParser, which is useful/easy for getting the body text or determining if there is one (example). Handling attachments is another matter and is not well documented in Mail::MboxParser.

    That is where MIME::Entity might prove more useful. There is an example in the documentation showing how to "Muck about with the body data:" under "Manipulation examples". This will probably take a good bit of experimentation though.

    --Jim

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://199994]
Approved by virtualsue
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found