Solved

Use perl to forward emails

Posted on 2011-09-26
3
473 Views
Last Modified: 2012-08-13
I'm been using Mail::POP3Client to parse email from exchange server. I can get all the information I need including attachments and save the attachment on the linux box. But when the filename is too long, I need to find a way to forward the email to an error account. I used this to get the $message from exchange server:

$pop3 = new Mail::POP3Client(
            USER     => "$USERNAME[$i]",
            PASSWORD => "$PASSWORD[$i]",
            HOST     => "$HOST[$i]",
            USESSL   => 1
 );

my $message = $pop3->HeadAndBody($i); where $i is the index of the email.

If I find something wrong with the message (say, filename too long), is there a way to forward this $message without going to extracting all the information including attachments in order to use MIME::Lite?

Thanks!


0
Comment
Question by:mybluegrass
3 Comments
 
LVL 9

Accepted Solution

by:
parparov earned 500 total points
Comment Utility
You can use something like Email::Simple:
http://search.cpan.org/~rjbs/Email-Simple-2.100/lib/Email/Simple.pm
to easily pass the required arguments to Mime::Lite
0
 
LVL 9

Expert Comment

by:Suhas .
Comment Utility
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now