Solved

Use perl to forward emails

Posted on 2011-09-26
3
506 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Email validation in proper way is  very important validation required in any web pages. This code is self explainable except that Regular Expression which I used for pattern matching. I originally published as a thread on my website : http://www…
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…
Six Sigma Control Plans

724 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