SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    phpLD Fanatic bronze trophy dvduval's Avatar
    Join Date
    Mar 2002
    Location
    Silicon Valley
    Posts
    3,626
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Tools for Cleaning an email list

    Supposing I have a forum that was spammed or maybe another list that people joined over the years. I don't really want to sign up for a service as I have a good way to email my lists. I just need a good way to identify the bad ones. Are there maybe some PHP solutions that will follow the reply to address and identify the obvious bad email addresses that bounced after a couple of attempts or similar?

  2. #2
    SitePoint Evangelist captainccs's Avatar
    Join Date
    Mar 2004
    Location
    Caracas, Venezuela
    Posts
    516
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This will find out of an MX recored exists
    PHP Code:
    public function isDomain($email) {
        
    // split email address into username and domain.
        
    list($userName$mailDomain) = split("@"$email); 
        if (!
    checkdnsrr($mailDomain"MX")) { 
            return 
    $mailDomain;
        } 
        return 
    FALSE;
    // public function isDomain($email) 
    Wikipedia: MX record
    Denny Schlesinger
    web services

  3. #3
    phpLD Fanatic bronze trophy dvduval's Avatar
    Join Date
    Mar 2002
    Location
    Silicon Valley
    Posts
    3,626
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much. I am going to get this reviewed by our dev team. Sounds simple enough.

  4. #4
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    47
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The code you provided will just check for invalid email addresses (invalid due to domain not exists, etc). However, it does not provide clue about other invalid mailbox types.

    like mailbox unavailable, mailbox quota full, etc. Probably, telnetting to SMTP ports to the mail server in question will properly respond with the status.
    PM me for Professional Email Marketing Service

  5. #5
    SitePoint Evangelist captainccs's Avatar
    Join Date
    Mar 2004
    Location
    Caracas, Venezuela
    Posts
    516
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RackSpider View Post
    The code you provided will just check for invalid email addresses (invalid due to domain not exists, etc).
    This is correct. It's a partial solution that helps cut down on badly addressed mail. I use it to check the input and it helps to pick up typos. If a user of a contact form gives a bad email address and never receives a rely, he does not blame himself but the contact form -- he figures he was ignored.

    However, it does not provide clue about other invalid mailbox types like mailbox unavailable, mailbox quota full, etc. Probably, telnetting to SMTP ports to the mail server in question will properly respond with the status.
    By using mail() [but not imap_mail()] php sets the correct bounce address [Return-path:] Here is the one from the SitePoint forum alert mail:
    Code:
    Return-path: <bounces+12300-fa47-user=myDomain.info@email.sitepoint.com>
    where "user=myDomain.info" is my email address. By setting up a catch-all sitePoint gets the desired feedback.
    Denny Schlesinger
    web services


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •