473,811 Members | 3,087 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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(\@E mailLines);
$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 3640
Never mind, I managed to fix it myself.

-Nils Magne

"Nils M. Lunde" <ni****@options .no.nospam> wrote in message
news:RP******** ************@gi ganews.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(\@E mailLines);
$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
1543
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 generated email address, so that I can relate bounces, notification failures, etc, to the original address to which the email was sent.
7
6077
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 the client know. Off late we are receiving very, very few of these emails. It turns out, with amount of spamming going on most of the companies have set up filters. As a result, most of emails, even though incorrect don't get bounced back.
2
25617
by: Justin | last post by:
Could someone please explain what is meant by bouncing the application server? Thank you.
4
2643
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
2292
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 excist; 3. The e-mail bounce, because the e-mail box is full. Is it posible to check these options?
3
2218
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 error message is... the only reliable way i can think of it so search for the error message by name,
2
2007
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 in fact damage a newsgroup's health. This post is a seasonal feature on behalf of the bouncier regulars here. news:comp.lang.c++ discusses an advanced language often thrust upon neophytes. They frequently misunderstand the relationships...
3
2562
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 time' in DB2 is an hour behind. If the OS is correct, shouldn't DB2 also be correct? To fix it, do I only need to bounce the DB2 instance so that it sees the
18
2395
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? While you're at it, might as well fix it for everybody else too. ;) Its a bit rude to send out mass e-mail messages with headers faked up so that the bounce messages go to somebody else.
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10398
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9215
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7676
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5567
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5702
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4357
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3028
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.