Bounce Email

N

Nils M. Lunde

Hi!

I'm trying to do the following:

-Extract an Email from a mailbox using grepmail
-Bounce this Email to a different address

I thought that this would be an easy thing to do, but I still haven't manage
to do it the way I want to.

The problem is MIME encoded messages.
I've tried several approches, but I always get the same result: the Email
Content-type is always text/plain after I've sent it.
It seems like some of the header is stripped off.

Here is my code:

##########################################
....
use MIME::parser;
use MIME::Entity;
use MIME::Head;

my $sCmd = "grepmail -iu -Y \'(\^From:)\' $sMyAddress $sPathToMailbox;
my @EmailLines = `$sCmd`;

my $oParser = new MIME::parser;
my $oEmail = $oParser->parse_data(\@EmailLines);
$oEmail->head->replace("To", $sBounceAddress);

my $sRes = $oEmail->smtpsend;
....
##########################################

Does anyone have a suggestion on how I can forward the mail without
stripping the header?

Thanx in advance!

-Nils Magne Lunde
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top