Great Circle Associates Majordomo-Users
(February 2000)
 

Indexed By Date: [Previous] [Next] Indexed By Thread: [Previous] [Next]

Subject: Re: email validator
From: Clay Irving <clay @ skechers . com>
Date: Fri, 4 Feb 2000 17:47:15 -0800
To: ramon via lepton <ramon @ etown . com>
Cc: majordomo-users @ GreatCircle . COM
In-reply-to: <Pine.GSO.4.21.0002041346590.21809-100000@lepton.etown.com>; from ramon via lepton on Fri, Feb 04, 2000 at 01:47:35PM -0800
References: <Pine.GSO.4.21.0002041346590.21809-100000@lepton.etown.com>

On Fri, Feb 04, 2000 at 01:47:35PM -0800, ramon via lepton wrote:

> Does anyone have a working email validator for majordomo lists?

I use the Perl module Email::Valid to weed out obvious bad addresses:

#!/usr/local/bin/perl

use Email::Valid;

$input_file     = "foo.txt";             # Input file
$good_addresses = "good.txt";            # File to store good addresses
$bad_addresses  = "bad.txt";             # File to store bad addresses

open F, "$input_file" or die "$!\n";
open G, ">$good_addresses" or die "$!\n";
open R, ">$bad_addresses" or die "$!\n";

while ($address = <F>) {                 # Read the list of Email addresses
  chomp $address;
  $address =~ s/^\s+//;                  # Remove spaces in the Email address
  $valid = new Email::Valid;
  if ($valid->address( -address => $address)) {
    print G "$address\n";                # The address is valid
  } else {
    print R "$address\n";                # the address is not valid
  }
}

-- 
Clay Irving
clay@skechers.com


Follow-Ups:
References:
Indexed By Date Previous: Re: Patch to "invisibly" zubscribe someone to a list?
From: Andrew Scott <atscott@thenew.net>
Next: Help
From: Chris Hoyt <choyt@fresno.edu>
Indexed By Thread Previous: email validator
From: ramon via lepton <ramon@etown.com>
Next: Re: email validator
From: Jack Schnapper <jack@kajor.com>

Google
 
Search Internet Search www.greatcircle.com