87 |
|
PeerAddr => $server, |
88 |
|
PeerPort => $port, |
89 |
|
Proto => 'tcp' |
90 |
< |
) or die "Cannot connect!"; |
90 |
> |
) or die "Connection to server broken\n"; |
91 |
|
|
92 |
|
if(!defined $sock) { |
93 |
< |
print "unable to connect to mailinfo server: $server:$port"; |
93 |
> |
print "Connection to server broken\n"; |
94 |
|
exit(1); |
95 |
|
} |
96 |
|
|
107 |
|
|
108 |
|
# send the query |
109 |
|
print $sock "$mode $name\n"; |
110 |
+ |
$response = ""; |
111 |
|
|
112 |
|
# read and print the response |
113 |
|
while($response ne ".\n") { |
114 |
|
$response = <$sock>; |
115 |
< |
print "$response" unless $response eq ".\n"; |
115 |
> |
if($response =~ s/^\?/mailinfo: /) { |
116 |
> |
print $response; |
117 |
> |
} |
118 |
> |
else { |
119 |
> |
print $response unless $response eq ".\n"; |
120 |
> |
} |
121 |
|
} |
122 |
|
|
123 |
|
# quit and close |