summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-ximapurge.pl5
1 files changed, 3 insertions, 2 deletions
diff --git a/imapurge.pl b/imapurge.pl
index 6623ba8..d23f1a1 100755
--- a/imapurge.pl
+++ b/imapurge.pl
@@ -75,13 +75,14 @@ sub prune {
$count += $#msgs;
my $del = $client->delete_message(\@msgs)
or die "Can't delete messages: $@\n";
- warn " Folder `$folder': only $del message deleted, out of $#msgs\n"
+ warn " Folder `$folder': only $del messages deleted, out of $#msgs\n"
unless $del == $#msgs+1;
}
$client->close or die "Can't close: $@\n";
}
}
- $client->logout() or die "Can't logout: $@\n";
+ $client->logout();
+ die "Can't logout: $@\n" unless $client->IsUnconnected;
return $count;
}