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