Great Circle Associates List-Managers
(December 1992)
 

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

Subject: Re: How to deal with bounces
From: "Michael H. Morse" <mmorse @ z . nsf . gov>
Date: Tue, 15 Dec 1992 08:36:27 EST
To: Gene Rackow <rackow @ antares . mcs . anl . gov>, Gess Shankar <gess @ knex . gwinnett . com>
Cc: list-managers @ GreatCircle . COM
In-reply-to: Gene Rackow <rackow @ antares . mcs . anl . gov> "Re: How to deal with bounces" (Dec 14, 10:09pm)

> Something that I've been thinking about adding into majordomo is a
> way to have a list of addreses to check before adding them to the
> list.  If the address is in the bozo list, the request will be
> denied with some message (possibly) until the list maintainer has
> been notified that the bozo address has been corrected in a way suitable
> to both parties.  There are some addresses that keep popping up bad
> and the user keeps sending in subscribe me messages just to stay on the
> list, even though his address, or something, is flakey at best.

Does majordomo check addresses at all before putting them on the list?
I'm pretty sure that Listserv for Unix does not.  I have a little
Perl script (I'm starting to sound like a broken record) that uses
nslookup to at least check that the host name is in the DNS.  That
has almost totally cut out bounces on a non-listserv system I run.
If anyone's interested, I've included it here.  It's not perfect, but
it does most of the job.

--Mike

#!/usr/local/bin/perl
# a script to check a mail address
# returns 0 if OK (far as we know)
# returns 1 if not.

$debug = 0;
$tmp = "/tmp/chkaddr$$";
if ($#ARGV != 0){
   print("usage: check_addr address\n");
   &leave(1);
}
$test = $ARGV[0];

# actually, the first two tests, for 1) embedded spaces and 
# 2) no @ sign will never fail, because download prevents
# spaces, and adds "@nsf.gov" to addresses without an @.

# does it have spaces?
$num_spaces = $test =~ tr/ / /;
if ($num_spaces){
   &leave(1);
}

# does it have an @?
$num_ats = $test =~ tr/\@/\@/;
if ($num_ats != 1){
   &leave(1);
}

# does it have a rhs and lhs?
($lhs,$rhs) = split(/@/,$test);
if (! $lhs || ! $rhs) {     # must have both a rhs and lhs
   &leave(1);
}

# does the rhs have dots?
$num_dots = $rhs =~ tr/././;
if (! $num_dots) {
   &leave(1);
}

# if it has just one dot, does it end with "BITNET"?
if ($num_dots == 1) {
   if ($rhs =~ /\.bitnet$/i) {
      &leave(0);
   }
}

# OK, everything looks pretty good, let's try nslookup
open(LOOK,"|/usr/etc/nslookup > $tmp 2>$tmp") || &leave(1);
print LOOK<<EOM;
$rhs
set querytype=MX
$rhs
EOM
close(LOOK);
open(IN,$tmp) || &leave(1);
while(<IN>){    # look at non-MX query
   if (/^> >/){
      last;
   }
   if (/^Name/) {
      $try = <IN>;
      if ($try =~ /^> >/){
         last;               # shouldn't happen
      }
      if ($try =~ /^Address:\s+\d+\./) { # looks good
         &leave(0);
      }
   }
}
while(<IN>){    # look at MX query
   chop;
   if (/mail exchanger =/){
      &leave(0);
   }
}
&leave(1);


sub leave {
   if($debug){
      print("Exit $_[0].\n");
   }
   if( -e $tmp) {
      unlink($tmp);
   }
   exit ($_[0]);
}



Follow-Ups:
Indexed By Date Previous: Re: How to deal with bounces
From: "Michael H. Morse" <mmorse @ z . nsf . gov>
Next: Re: How to deal with bounces
From: mickey!sullivan @ csvax . cs . caltech . edu (Michael Sullivan)
Indexed By Thread Previous: Re: How to deal with bounces
From: "Michael H. Morse" <mmorse @ z . nsf . gov>
Next: How to deal with bounces
From: dupuy @ tiemann . cs . columbia . edu (Alexander Dupuy)

Google
 
Search Internet Search www.greatcircle.com