Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Perl to process "mbox" file
December 28, 2009, 7:40 pm
rate this thread
Can someone please point me to a way to accomplish the following task.
I have made a copy of my "mbox" file in my AIX account, for processing
I w'd like to automate:
1. Run through the mbox copy, and for each mail, using some logic on
fields like From, Date/Time, Subject, decide whether or not it is a
mail of interest.
2. If it is a mail of interest, examine whether or not it has
attachments. Then, save the attachments to a directory.
The attachments w'd be of type: *.txt, *.ps, *.pdf, *.doc
I have used PERL in the distant past for scripting on Unix, so thought
of going back to PERL.
I was hoping the PERL gurus w'd point me to a way to accomplish the
above, which I w'd have to do manually otherwise. The number of mails
in the mbox is quite large, so wish to automate.
Thanks a lot for your help,
Re: Perl to process "mbox" file
(I don't know either, they just turned up on google "perl mbox" and their
description seems to fit).
Mail::MboxParser::Mail has methods to get the attachments and headers.
The example code given in the above pages should get you started. Feel
free to post more specific questions (together with your code so far, and
a short mbox file for testing).
- » FAQ 8.31 Can I use perl to run a telnet or ftp session?
- — Next thread in » PERL Discussions
- » FAQ 8.44 How do I tell the difference between errors from the shell and perl?
- — Previous thread in » PERL Discussions