October 10th, 2000, 04:21 PM
I'm developing a mailing list manager in PHP/MySQL. The idea is to have as many features as possible and I'm half way there. I just wonder if anyone here would know how to eliminate bounced email addresses so they just get removed from the database.
I have this idea to check MX mail server so it would check if the email address actually exists when the user is subscribing. That would be my first step, then (as a lot of bounced email addresses would still go through and because people change email addresses later). I thought that the if the email address bounced that it would be removed.
Any ideas or suggestions on how this can be accomplished would be great.
October 10th, 2000, 06:09 PM
You're going to have many hours of fun with this one!
First, when you send your messages you need to make sure that the From/Reply-to points to a dedicated mailbox for holding bounces.
Then, use PHP's IMAP functions to read the mailbox and parse the mail item subjects for "Permanent fatal errors" and the relevant To: address. You could either run this "on demand" or use cron to run the script automatically every day/whatever. You can cron a PHP script by running it through the lynx browser.
There's quite a lot of messages on this board about PHP and cron: do a search for "cron lynx" or similar.
Read the PHP manual details about IMAP functions (which include POP3). Your PHP installation needs to be compiled with this option selected.
It might be an idea to set a threshold that only deletes the mail address from the list if it bounces say, three times. In which case, you need an extra data item in your mail list that keeps a count of the number of bounces. Then before each mailout just trawl the mail list and delete all the addresses whose bounce count exceeds your threshold.
October 11th, 2000, 04:03 AM
I really appreciate your help.
Back to coding it now.