473,569 Members | 2,793 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dealing with Bounced Email

I've written a simple e-newsletter app using the PHP mail() command.

I want to be able to deal with bounce-backs if a member's email is no
longer working or is using an old account. I'm using a Red Hat Linux
server with Sendmail and Apache. I've seen mention of using Procmail or
filtering mail to a certain account through a PHP script, but, can't
find detailed instructions on how this is done.

Can anyone let me know or point me toward a site that explains how to
handle bounced-back email using Sendmail and a PHP script?

Thanks!

Jul 21 '05 #1
7 12439
Monty wrote:
I've written a simple e-newsletter app using the PHP mail() command. Can anyone let me know or point me toward a site that explains how to
handle bounced-back email using Sendmail and a PHP script?


Try this:

mail($To,$Subje ct,$Msg,$header s, '-f'.$returnaddre ss);
where $returnaddress = your email.

HTH

- Nicolaas
Jul 21 '05 #2
>"mail($To,$Sub ject,$Msg,$head er*s, '-f'.$returnaddre ss);

where $returnaddress = your email. "


this would not help as the action is not automated... try setting up
an account that will be monitored by a script:
On receving mail, remove sender's adress from database, also search
body for e-mail adresses and remove them.

Jul 21 '05 #3
Ye*********@gma il.com wrote:
"mail($To,$Subj ect,$Msg,$heade r*s, '-f'.$returnaddre ss);

where $returnaddress = your email. "


this would not help as the action is not automated... try setting up
an account that will be monitored by a script:
On receving mail, remove sender's adress from database, also search
body for e-mail adresses and remove them.

It sounds like you have a mailing list and you are trying to automate the
remove response.

It is easier to let people go to a specific page to remove.

e.g.
click on the link to remove
http://www.yoururl.org/remove.php?client=1231232

then remove.php:

<?

if ( client_id_exist s($client) ) {
if ( remove_client_f rom_database($c lient) ) {;
echo "thank you for taking the time. your address has been removed";
}
}

function remove_client_f rom_database {
runsql
}

etc....
?>
Jul 21 '05 #4
Ye*********@gma il.com wrote:
"mail($To,$Sub ject,$Msg,$head er*s, '-f'.$returnaddre ss);

where $returnaddress = your email. "


this would not help as the action is not automated... try setting up
an account that will be monitored by a script:
On receving mail, remove sender's adress from database, also search
body for e-mail adresses and remove them.


Okay, but, how does one set up a PHP script to monitor bounced email
coming back to the account I've already set up? That's the part I have
no idea how to do.

Jul 22 '05 #5
windandwaves wrote:

It sounds like you have a mailing list and you are trying to automate the
remove response.


No, what I want to do is deal with the bounce-backs after sending a
broadcast email -- email that is returned because the email address is
no longer active or valid. I want to set up a PHP script to
automatically detect the returned email message, grab the email address
from the bounced back email, then remove that email from the database.

Specifically, I'm not sure how to go about using a PHP script with
Sendmail to lift the TO: email address from a bounced back email when
it is returned to the email account i have set up as the Return Path.

Jul 22 '05 #6
>> >"mail($To,$Sub ject,$Msg,$head er*s, '-f'.$returnaddre ss);
>
>where $returnaddress = your email. "


this would not help as the action is not automated... try setting up
an account that will be monitored by a script:
On receving mail, remove sender's adress from database, also search
body for e-mail adresses and remove them.


Okay, but, how does one set up a PHP script to monitor bounced email
coming back to the account I've already set up? That's the part I have
no idea how to do.


There are several approaches:

(1) If you have a system which supports it (e.g. Linux or UNIX using
sendmail, smail, Exim, etc.), you can forward mail received by a
user into a pipe by specifying this in a .forward file in the user's
home directory. The program (which could be written in just about
anything: standalone PHP, Perl, sh, C, or whatever) will be invoked
with the email text (including the headers) on stdin. Details of
what user the program will run as or what the current working
directory will be may vary. Whether or not the admin has turned
this off or not may vary also. It is up to the program to go
through the headers and body to figure out what to do with it.

(2) You could set up a cron job which periodically invokes a program
which polls a mailbox using POP3, IMAP, or just opens the mailbox
file directly. For example, fetchmail can be used to transfer the
mailbox contents to a local file. Then a program could look at
what came in. The host with the program doesn't have to be the same
host as the one with the mailbox, in the case of POP3 or IMAP polling.

Gordon L. Burditt
Jul 22 '05 #7
On 2005-07-22, Monty <mo****@hotmail .com> wrote:
Specifically, I'm not sure how to go about using a PHP script with
Sendmail to lift the TO: email address from a bounced back email when
it is returned to the email account i have set up as the Return Path.


man procmail
--
Met vriendelijke groeten,
Tim Van Wassenhove <http://timvw.madoka.be >
Jul 23 '05 #8

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

Similar topics

2
1971
by: Rob Imbeault | last post by:
Hi Guys, I am building a script that catches emails. I have access to the email source and I would like to distinguish between bounced emails, auto-replies and real replies. Is there a standard that all servers follow for rejected emails. I am looking for a unique string I can search for like "Mail Administrator" or "Failed email." ...
2
3064
by: Atanu | last post by:
Im using System.Web.Mail to send emails to the users. Now i want to receive the bounced mails in a different email id from that of the from(sender) id. Im doing something like this... MailMessage mail=new MailMessage(); mail.Headers.Add("Return-Path","id@domain.com"); but the bounced mails are coming back to from id. Initially i...
3
2387
by: Jishnu | last post by:
Hi ASP Gurus out there, I have question. I am wondering if any one can guide me towards a script that can handle bounced emails from a newsletter campaign. I am not interested in .Net solution. The mail server is Exchange 2003 if that helps. Right now clueless about tracking of bounced emails Thanks
2
2689
by: DaveF | last post by:
I have an email program in asp.net. Is there a way to check email for bounced email? -- dave
1
2278
by: dw | last post by:
Hi. I accidentally posted this to the German version ("de") of this newsgroup until I realized my mistake -- sorry! We're using the subroutine below to send emails via our classic ASP apps. However, we'd like to know if an email address isn't good -- in other words, it bounced back. Is there a way to do that with the CDOSYS email method?...
2
1879
by: SharpSmith | last post by:
hi all i have a very specific question regarding emails sending and googling doesn't help me is a way exists to send email using .NET framework (System.Web.Mail or something else) and have the "from" address to be X but if the message is bounced from not existing address or whatever, it will be returned to adress Y ? i tried to work by...
1
7130
by: Frank | last post by:
Hello All, I am exploring and developing a plan for a C# web app or windows app to handle bounced emails. Basically, I need to develop a system where I weed out bad addresses in our db...but after reading the articles listed below, I see that there are various responses the server will respond with if the send fails. I would like to...
2
1635
by: Ripendra007 | last post by:
hi all, can any body tell me how should i come to know that my e mail tha i hav sent is bounced and how to handles or update my database that ..this user or email Id is bounced..I have to do all this in the asp.net using C# ....by the way i could find that the mail i sent is whether red or not but i dont hav idea how to find the bounced...
1
1786
by: Stuart Harden | last post by:
We use Exchange 2007, but asp.net programs we have written to send out the mail. Is there an asp.net control to request the bounce backs be to a specific address? We can of course do this on the client end; it would be "simple" enough to have the logged in "from" person set a filter on their incoming mail software which would forward the...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8119
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...
0
7964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6281
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...
1
5509
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...
0
3653
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...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
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
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.