Leser: 7
|< 1 2 3 >| | 22 Einträge, 3 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/perl -w
$| = 1;
my $smtp = 'smtp.mail.ru';
my $dns = '208.67.222.222';
print "Content-type: text/plain; charset=windows-1251\n\n" if $ENV{HTTP_USER_AGENT};
#print "Local server test\n";
#print "\n\n";
my $s = IO::Socket::INET->new(Proto => "tcp", LocalPort => 36000, Listen => SOMAXCONN, Reuse => 1);
unless ($s) { print "Error"; } else { close $s; }
#print "\n\n";
#print "DNS client test ($dns)\n";
#print "\n\n";
my $r = (gethostbyname $dns)[4];
unless ($r) { print "Error > Can't resolve DNS hostname"; exit; }
$s = IO::Socket::INET->new(Proto => "tcp", Type => SOCK_STREAM);
unless ($s) { print "Error > Can't create socket > $!"; exit; }
unless ($s->connect(pack ("Sna4x8", 2, 53, $r))) { close $s; print "Error > Can't connect > $!"; exit; }
close $s; #print "Ok";
#print "\n\n";
#print "SMTP Client test ($smtp)\n";
#print "\n\n";
$r = (gethostbyname $smtp)[4];
unless ($r) { print "Error > Can't resolve SMTP hostname"; exit; }
$s = IO::Socket::INET->new(Proto => "tcp", Type => SOCK_STREAM);
unless ($s) { print "Error > Can't create socket > $!"; exit; }
unless ($s->connect(pack ("Sna4x8", 2, 25, $r))) { close $s; print "Error > Can't connect > $!"; exit; }
$r = <$s>; close $s;
if (length $r) { print "OK"; } else { print "Error > Can't read response"; }
|< 1 2 3 >| | 22 Einträge, 3 Seiten |