Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

tlug: finally ip-up script for smtp server



Hi, 
I found the third mail server that won't accept bogus domain 
name.
This finally initiated the script:

 >> #!/usr/bin/perl
 >> my $name, $first, $localip;
 >> shift;
 >> shift;
 >> $localip=shift;
 >> 
 >> if(open (FILE, "dig -x $localip|")) {
 >>         while (<FILE>) {
 >>                 $_ =~ /PTR\W+(.+)\.$/;
 >>                 $name = $1;
 >>         }
 >>         close(FILE);
 >> }
 >> 
 >> $first = $name;
 >> $first =~ s/([^\.]+)\..*/$1/;
 >> if($name) {
 >>         if(open(FILE,">>/etc/hosts")) {
 >>                 print FILE "$localip    $name   $first\n";
 >>                 close(FILE);
 >>                 system "hostname $first";
 >>         }
 >> }

It keeps concatenating /etc/hosts and fails to send defered 
mails. But it works.

Regards,
Kei.

---------------------------------------------------------------
Next Nomikai: 15 May Fri, 19:30 Tengu TokyoEkiMae 03-3275-3691
Next TLUG Meeting: 13 June Sat, Tokyo Station Yaesu gate 12:30
Featuring Stone and Turnbull on .rpm and .deb packages
---------------------------------------------------------------
a word from the sponsor:
TWICS - Japan's First Public-Access Internet System
www.twics.com  info@example.com  Tel:03-3351-5977  Fax:03-3353-6096

--------------------------------------------------------------
Next Nomikai: 17 July, 19:30 Tengu TokyoEkiMae 03-3275-3691
Next Meeting: 8 August, Tokyo Station Yaesu central gate 12:30
featuring Linux on multiple platforms:
i386, Sparc, PA-Risc, Amiga, SGI, Alpha, PalmPilot, ...
--------------------------------------------------------------
Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links