Great Circle Associates Majordomo-Workers
(November 1996)
 

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

Subject: Domain name verification
From: Brock Rozen <brozen @ webdreams . com>
Date: Sun, 24 Nov 1996 04:54:32 -0500 (EST)
To: Majordomo Workers List <majordomo-workers @ greatcircle . com>
Reply-to: Brock Rozen <brozen @ webdreams . com>

I just found the following code "laying around" in one of my programs.
(It's stolen though, but I forget whom to give credit to) What
do you guys think about adding it in?

It DOES require the domain name to be broken up into pieces, and I have
code that does that -- but it's broken (it will only work with domain
names that have only one period -- so that will have to be fixed)

Such code could be used during the subscribe procedure.



sub domainresolve {

 # Resolve IP if needed
    if ($email_domain =~ /\d+\.\d+\.\d+\.\d+/) {
      if ($dnscache{$email_domain}) {
        $email_domain=$dnscache{$email_domain};
        $cachehits++;  }
      else {
    ($domain,$junk)=gethostbyaddr(pack('C4',split(/\./,$email_domain)),2);
        ($domain)?($ipresolved++):($domain=$email_domain);
        $dnscache{$email_domain} = $domain;
        $email_domain=$domain;
        }
    }
    # Get the domain, if there is one.
    ($domain) = ($email_domain =~ /([^\.]+\.[^\d\.]+)$/o);
    ($domain) || ($domain = "$email_domain") & ($valid_addr = 'ipbad');
      $email_domain = $domain;
}


sub divide_addr {

($email_name, $email_domain) = split(/\@/, $email);

}

sub undivide_addr {

if ($email =~ /\@/) {
$email = "$email_name" . '@' . "$email_domain";
} else {
$email = "$email_name";
}

}


 ------------------------------------------------------------------------- 
 | Brock Rozen | brozen@webdreams.com | http://www.webdreams.com/~brozen | 
 ------------------------------------------------------------------------- 





Follow-Ups:
Indexed By Date Previous: Majordomo v1.94 -- infinite loop
From: mikhail@klm.com (Mikhail Kuperblum)
Next: Re: Domain name verification
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>
Indexed By Thread Previous: Majordomo v1.94 -- infinite loop
From: mikhail@klm.com (Mikhail Kuperblum)
Next: Re: Domain name verification
From: Jason L Tibbitts III <tibbs@hpc.uh.edu>

Google
 
Search Internet Search www.greatcircle.com