OpenSource email list Cleaning script

Discussion in 'Products & Tools' started by webdevoman, Jul 31, 2014.

  1. #1
    If this is not the correct forum for this please pardon me.

    I have an email list from a forum community I own and I am looking to clear the list of old addresses that are no longer valid, etc. I see many expensive options for doing this but is there anything open source available?

    Thanks,
    Rich
     
    webdevoman, Jul 31, 2014 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,792
    Likes Received:
    4,529
    Best Answers:
    123
    Trophy Points:
    665
    #2
    I haven't done anything like that in years but the simplest way is just to write a quick php script that runs down the list and checks the mx records to see if it would be deliverable.

    Something like this is a step along the way

    <?php
    function domain_exists($email, $record = 'MX'){
    list($user, $domain) = explode('@', $email);
    return checkdnsrr($domain, $record);
    }
    if(domain_exists('sarah@somedomainifound.com')) {
    echo('This MX records exists; I will accept this email as valid.');
    }
    else {
    echo('No MX record exists; Invalid email.');
    }
    Code (markup):
     
    sarahk, Jul 31, 2014 IP
  3. webdevoman

    webdevoman Active Member

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    86
    #3
    That is a great idea. Thanks!
     
    webdevoman, Jul 31, 2014 IP
  4. melbek

    melbek Active Member

    Messages:
    49
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #4
    I would also check that the MX server will accept email for the domain, e.g. RCPT TO:
     
    melbek, Aug 25, 2014 IP
  5. Mayank Chaudhary

    Mayank Chaudhary Greenhorn

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #5
    Came across online email validator tool. Try out emailpapaya.com.
     
    Mayank Chaudhary, Feb 26, 2015 IP