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.
Email Delivery Failures .
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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.
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.
-
rameshmrgn
- Forum Newbie
- Posts: 15
- Joined: Sat Jun 17, 2006 1:01 am
hi
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?
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?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: hi
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.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?
-
rameshmrgn
- Forum Newbie
- Posts: 15
- Joined: Sat Jun 17, 2006 1:01 am
hi
could u help me write script to pick up the bounced emails though?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: hi
Not really no sorry, I'm too busy, but I can give you some hints.rameshmrgn wrote:could u help me write script to pick up the bounced emails though?
(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.
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.
It's not easy of course, and how you do it depends entirely on your server set up.