Track undeliverable mail

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fitchic77
Forum Commoner
Posts: 51
Joined: Thu Jul 20, 2006 11:57 pm

Track undeliverable mail

Post by fitchic77 »

How can you do this?

I have an email tool I built in php that sends email out and I need to know which get bounced back.

Any help would be appreciated!!
:roll:
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

If you specify a Return-Path when you send it (swift makes this easy but it's possible to do with mail() too) then you can open that mailbox and scan it for messages.
fitchic77
Forum Commoner
Posts: 51
Joined: Thu Jul 20, 2006 11:57 pm

Post by fitchic77 »

I just need to know how many are bounced back for stats. I don't need to read the mail.

thanks!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

fitchic77 wrote:I just need to know how many are bounced back for stats. I don't need to read the mail.

thanks!
In that case you don't know what you need to know ;)

You DO need to read the email. PHP will have to open the mailbox and parse the messages. Either that or you set up a system filter to catch the mail at the MX. SMTP is a wonderfully basic archaic protocol. Messages get delivered to a MX, the MX tries to deliver them, if it fails it looks for the address in the Return-Path (the MAIL FROM envelope) and it sends a failure note to that address?

How would you like it to happen?

http://www.php.net/imap
Post Reply