#!/usr/bin/perl -w
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
#NAME
#  hostads -
#
#SYNOPSIS
#  hostads 
#
#REQUIRES
#
#DESCRIPTION
#  Silly little script to probe for speakeasy mail server addresses.
#
#OPTIONS
#
#EXAMPLES
#
#FILES
#
#BUGS
#
#  We only ask about names of the form "mail$m.sea$s.speakeasy.net".
#
#  We only find addresses; we don't test for a live  server.   Some  of  them
#  might be reserved addresses and names that aren't in use yet.
#
#SEE ALSO
#
#AUTHOR
#  John Chambers <jc@trillian.mit.edu>
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

$| = 1;
$exitstat = 0;
($P = $0) =~ s".*/"";
$V = $ENV{"V_$P"} || $ENV{"D_$P"} || 1;	# Verbose level.

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #

$mlo = 0;
$mhi = 255;
$slo = 0;
$shi = 255;

for $m ($mlo .. $mhi) {
	for $s ($slo .. $mhi) {
		$h = "mail$m.sea$s.speakeasy.net";
		print "---	$h\n" if $V>1;
		$a = `ipad $h 2>/dev/null`;
		$a =~ s/[\r\s]$//;
		print "$a	$h\n" if $a;
	}
}

print "$P: Exit with status $exitstat.\n" if $V>1;
exit $exitstat;
