From d55a5c24b28b1ea7c3c2cde6acd840e177caedb0 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Fri, 6 Jan 2012 20:22:28 +0100 Subject: wibble --- imapurge.pl | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/imapurge.pl b/imapurge.pl index 1ea7768..df8c40e 100755 --- a/imapurge.pl +++ b/imapurge.pl @@ -17,7 +17,7 @@ use strict; =head1 NAME -imapurge.pl - Prune your email accounts +imapurge.pl - prune your email accounts =head1 SYNOPSIS @@ -25,29 +25,26 @@ B =head1 DESCRIPTION -B cleans up your accounts from old seen and unflagged emails -that are not drafts. It connects on the IMAP servers via SSL on port 993. +B cleans up your accounts from B B and B emails +that are B. It connects on the IMAP servers via SSL on port 993. =head1 CONFIGURATION B reads its configuration from the file I<$HOME/.imapurge.rc>. This file has to be the content of a Perl hash e.g., -=over 4 - -account1 => { - hostname => 'imap.example.com', - username => 'username', - password => '******', - ignore => [ 'folder1', 'folder2' ], - only => [ 'folder3', 'folder4' ], - oldest => 90 -}, - account2 => { - ... -} + account1 => { + hostname => 'imap.example.com', + username => 'username', + password => '******', + ignore => [ 'folder1', 'folder2' ], + only => [ 'folder3', 'folder4' ], + oldest => 90 + }, + account2 => { + ... + } -=back The fields I, I, and I are required, while I, I, and I are optional. @@ -69,10 +66,10 @@ Copyright 2011 Guilhem Moulin. See the source for copying conditions. =cut - -pod2usage(-exitstatus => 0, -verbose => 2) if @ARGV && $ARGV[0] eq '--man'; -pod2usage(2) if @ARGV; - +if (@ARGV) { + pod2usage(-exitstatus => 0, -verbose => 2) if $ARGV[0] eq '--man'; + pod2usage(2); +} my $confile = catfile ($HOME, '.imapurge.rc'); die "Can't read `" .$confile. "'\n" unless -f $confile; @@ -144,7 +141,8 @@ sub prune { $count += $#msgs+1; my $del = $client->delete_message(\@msgs) or die "Can't delete messages: $@\n"; - warn " Folder `$folder': only $del/$#msgs messages have been deleted.\n" + warn " Folder `$folder': only $del/" .$#msgs+1 + ."messages have been deleted.\n" unless $del == $#msgs+1; } else { -- cgit v1.2.3