expn.pl (302408) | expn.pl (38032) |
---|---|
1#!/usr/bin/perl 2'di '; 3'ds 00 \\"'; 4'ig 00 '; 5# 6# THIS PROGRAM IS ITS OWN MANUAL PAGE. INSTALL IN man & bin. 7# 8 9use 5.001; 10use IO::Socket; | 1#!/usr/bin/perl 2'di '; 3'ds 00 \\"'; 4'ig 00 '; 5# 6# THIS PROGRAM IS ITS OWN MANUAL PAGE. INSTALL IN man & bin. 7# 8 9use 5.001; 10use IO::Socket; |
11use Fcntl; | |
12 13# system requirements: 14# must have 'nslookup' and 'hostname' programs. 15 | 11 12# system requirements: 13# must have 'nslookup' and 'hostname' programs. 14 |
16# $OrigHeader: /home/muir/bin/RCS/expn,v 3.11 1997/09/10 08:14:02 muir Exp muir $ | 15# $Header: /home/muir/bin/RCS/expn,v 3.11 1997/09/10 08:14:02 muir Exp muir $ |
17 18# TODO: 19# less magic should apply to command-line addresses 20# less magic should apply to local addresses 21# add magic to deal with cross-domain cnames 22# disconnect & reconnect after 25 commands to the same sendmail 8.8.* host 23 24# Checklist: (hard addresses) --- 970 unchanged lines hidden (view full) --- 995 996 if ((defined $mx{$server}) || (! $have_nslookup)) { 997 return 0 unless $lastchance; 998 &giveup('mx domainify',$giveup); 999 return 0; 1000 } 1001 1002 $0 = "$av0 - nslookup of $server"; | 16 17# TODO: 18# less magic should apply to command-line addresses 19# less magic should apply to local addresses 20# add magic to deal with cross-domain cnames 21# disconnect & reconnect after 25 commands to the same sendmail 8.8.* host 22 23# Checklist: (hard addresses) --- 970 unchanged lines hidden (view full) --- 994 995 if ((defined $mx{$server}) || (! $have_nslookup)) { 996 return 0 unless $lastchance; 997 &giveup('mx domainify',$giveup); 998 return 0; 999 } 1000 1001 $0 = "$av0 - nslookup of $server"; |
1003 sysopen(T,"/tmp/expn$$",O_RDWR|O_CREAT|O_EXCL,0600) || die "open > /tmp/expn$$: $!\n"; | 1002 open(T,">/tmp/expn$$") || die "open > /tmp/expn$$: $!\n"; |
1004 print T "set querytype=MX\n"; 1005 print T "$server\n"; 1006 close(T); 1007 $cpref = 1.0E12; 1008 undef $nserver; 1009 open(NSLOOKUP,"nslookup < /tmp/expn$$ 2>&1 |") || die "open nslookup: $!"; 1010 while(<NSLOOKUP>) { 1011 print if ($debug > 2); --- 289 unchanged lines hidden (view full) --- 1301watch, flag will cause 1302.B expn 1303to show you its conversations with the mail daemons. 1304Finally, the 1305.IR -d , 1306debug, flag will expose many of the inner workings so that 1307it is possible to eliminate bugs. 1308.SH ENVIRONMENT | 1003 print T "set querytype=MX\n"; 1004 print T "$server\n"; 1005 close(T); 1006 $cpref = 1.0E12; 1007 undef $nserver; 1008 open(NSLOOKUP,"nslookup < /tmp/expn$$ 2>&1 |") || die "open nslookup: $!"; 1009 while(<NSLOOKUP>) { 1010 print if ($debug > 2); --- 289 unchanged lines hidden (view full) --- 1300watch, flag will cause 1301.B expn 1302to show you its conversations with the mail daemons. 1303Finally, the 1304.IR -d , 1305debug, flag will expose many of the inner workings so that 1306it is possible to eliminate bugs. 1307.SH ENVIRONMENT |
1309No environment variables are used. | 1308No enviroment variables are used. |
1310.SH FILES 1311.PD 0 1312.B /tmp/expn$$ 1313.B temporary file used as input to 1314.BR nslookup . 1315.SH SEE ALSO 1316.BR aliases (5), 1317.BR sendmail (8), --- 43 unchanged lines hidden --- | 1309.SH FILES 1310.PD 0 1311.B /tmp/expn$$ 1312.B temporary file used as input to 1313.BR nslookup . 1314.SH SEE ALSO 1315.BR aliases (5), 1316.BR sendmail (8), --- 43 unchanged lines hidden --- |