Solved

Use perl to forward emails

Posted on 2011-09-26
3
494 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
ID: 36602262
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 .
ID: 37319354
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many situations when we need to display the data in sorted order. For example: Student details by name or by rank or by total marks etc. If you are working on data driven based projects then you will use sorting techniques very frequently.…
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…

685 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