Page 1 of 1

Email Delivery Failures .

Posted: Mon Mar 26, 2007 12:13 am
by rameshmrgn
Hi all,

Is it, possible to detect Email Delivery Fialures from our server side Script?

I want to count the No. of failure deliveries for a particular Email ID.

Any one plz....


Smiles,
Ramesh Muru.

Posted: Mon Mar 26, 2007 12:28 am
by Chris Corbyn
You need to set a return-path (bounce-detect) address and monitor it for bounces.

Using Swift Mailer: http://www.swiftmailer.org/wikidocs/v3/ ... ce_address

There are examples for how to do it with mail() in the PHP Manual.

hi

Posted: Mon Mar 26, 2007 2:01 am
by rameshmrgn
Thanks for your timely reply....

i would like to update my database automaticaly while Mail failure delivery acquire instead of sending failure mail status to some other Email ID...

is it possible?

Re: hi

Posted: Mon Mar 26, 2007 9:31 am
by Chris Corbyn
rameshmrgn wrote:Thanks for your timely reply....

i would like to update my database automaticaly while Mail failure delivery acquire instead of sending failure mail status to some other Email ID...

is it possible?
It's not possible to do at the exact same time you send no. You may have to wait up to 72 hours. You can write scripts to pick up the bounced emails though; it doesn't have to be done by a human.

hi

Posted: Mon Apr 02, 2007 2:06 am
by rameshmrgn
could u help me write script to pick up the bounced emails though?

Re: hi

Posted: Mon Apr 02, 2007 3:49 am
by Chris Corbyn
rameshmrgn wrote:could u help me write script to pick up the bounced emails though?
Not really no sorry, I'm too busy, but I can give you some hints.

(Assuming you don't have access the MX server config)

You need to use the IMAP functions or PEAR::IMAP to read the mailbox. Open the mailbox, look for messages that haven't been read, run some regex on the body to determine if you need to mark an email address as unusable. You may even need to run regex on the subject line/headers since you could potentially be wasting resources inspecting SPAM/Junk emails.

There's no "standard" bounce message so just collect as many different ones as you can and add the different strategies (in code) for reading them.

Posted: Mon Apr 02, 2007 4:41 am
by onion2k
One more thing.. in some cases when you try to send an email to someone your STMP server will fail (if there was no mailbox for the account for example, or if the user's mailbox is full). You should examine your mail logs as well if you're trying to ascertain whether an email was sent and/or received. Checking an return account for bounced emails will only tell you if the mail was sent but returned for some reason. Examining the mail logs, especially the SMTP return code, will tell you more. You really need to do both.

It's not easy of course, and how you do it depends entirely on your server set up.