Page 1 of 1
Track undeliverable mail
Posted: Thu Dec 07, 2006 8:51 am
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!!

Posted: Thu Dec 07, 2006 9:31 am
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.
Posted: Thu Dec 07, 2006 9:36 am
by fitchic77
I just need to know how many are bounced back for stats. I don't need to read the mail.
thanks!
Posted: Thu Dec 07, 2006 9:52 am
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