472,956 Members | 2,219 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,956 software developers and data experts.

Bounce Email

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
Jul 19 '05 #1
1 3596
Never mind, I managed to fix it myself.

-Nils Magne

"Nils M. Lunde" <ni****@options.no.nospam> wrote in message
news:RP********************@giganews.com...
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

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alan Kennedy | last post by:
Hi All, I'm writing an application that sends out emails, for workflow-item tracking purposes. I am using a VERP-style addressing mechanism, whereby I send each message from an uniquely...
7
by: VK | last post by:
Hello: Since our application uses ASP, I am posting this in this group. Pardon if wrong group. Our product/application replies a lot on bounced back emails, that way we correct this and let...
2
by: Justin | last post by:
Could someone please explain what is meant by bouncing the application server? Thank you.
4
by: Bloon | last post by:
I have a question that how to debug a program only having .exe file. Is there any techniques or tools that can do that? Thanks a lot.
2
by: Arjen | last post by:
Hello, When I send an e-mail to this sample e-mail address sample@mail.com then there are three options. 1. The e-mail comes over; 2. The e-mail bounce, because the e-mail address doesn't...
3
by: Darren Clark | last post by:
HI, I am after some assistance in finding what is the best way to parse through bounce back text...... because each server is different i cant really depend on Line x being the line where the...
2
by: Phlip | last post by:
Newsgroupies: One myth about USENET is that each group has a charter; some "official" list of on-topic concepts. When a post arrives "violating" this myth, the replies that support the myth can...
3
by: aj | last post by:
DB2 LUW v8.2 FP 14 RHAS 2.1 Regarding DST: My OS and java were successfully patched for DST, but the DB2 instance was never bounced. The OS returns the correct time, but a 'values current...
18
by: Grant Edwards | last post by:
Could whoever is responsible for the gateway that is grabbing my postings off of Usenet and e-mailing them out please fix the headers in the mail messages so that I don't get the bounce messages?...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.