--- misc/mailinfo/mailinfo.pl 2001/07/19 12:19:39 1.2 +++ misc/mailinfo/mailinfo.pl 2004/08/01 10:39:51 1.7 @@ -6,10 +6,10 @@ # A perl script that mimmicks the behaviour of the UKC # mailinfo client. Supports all functions except the -C # option to change mailstore. -# - T.D.Bishop@ukc.ac.uk +# - T.D.Bishop@kent.ac.uk # # $Author: tdb $ -# $Id: mailinfo.pl,v 1.2 2001/07/19 12:19:39 tdb Exp $ +# $Id: mailinfo.pl,v 1.7 2004/08/01 10:39:51 tdb Exp $ #------------------------------------------------------------ $| = 1; @@ -87,10 +87,10 @@ sub mailinfo() { PeerAddr => $server, PeerPort => $port, Proto => 'tcp' - ) or die "Cannot connect!"; + ) or die "Connection to server broken\n"; if(!defined $sock) { - print "unable to connect to mailinfo server: $server:$port"; + print "Connection to server broken\n"; exit(1); } @@ -107,11 +107,17 @@ sub mailinfo() { # send the query print $sock "$mode $name\n"; + $response = ""; # read and print the response while($response ne ".\n") { $response = <$sock>; - print "$response" unless $response eq ".\n"; + if($response =~ s/^\?/mailinfo: /) { + print $response; + } + else { + print $response unless $response eq ".\n"; + } } # quit and close