diff options
author | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-01-06 20:22:28 +0100 |
---|---|---|
committer | Guilhem Moulin <guilhem.moulin@ens-lyon.org> | 2012-01-06 20:22:28 +0100 |
commit | d55a5c24b28b1ea7c3c2cde6acd840e177caedb0 (patch) | |
tree | bdda2178c68e4ff0242491f05b18de3f55a4c4f7 | |
parent | 2ac97a96ec1207e83e7c2277440acdac30608985 (diff) |
wibble
-rwxr-xr-x | imapurge.pl | 42 |
1 files 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<imapurge.pl> =head1 DESCRIPTION -B<IMAPurge> 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<IMAPurge> cleans up your accounts from B<old> B<seen> and B<unflagged> emails +that are B<not drafts>. It connects on the IMAP servers via SSL on port 993. =head1 CONFIGURATION B<IMAPurge> 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<hostname>, I<username>, and I<password> are required, while I<ignore>, I<only>, and I<oldest> 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 { |