#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    3
    Rep Power
    0
    Hi,
    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.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Location
    London, England
    Posts
    251
    Rep Power
    15
    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.

    http://www.php.net/manual/ref.imap.php

    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.

    Good luck.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    3
    Rep Power
    0
    Thanks Adrian2,

    I really appreciate your help.
    Back to coding it now.

IMN logo majestic logo threadwatch logo seochat tools logo