2 # ss makes a screenshot of the screen using import, and is released
3 # under the terms of the GPL version 2, or any later version, at your
4 # option. See the file README and COPYING for more information.
5 # Copyright 2004 by Don Armstrong <don@donarmstrong.com>.
6 # $Id: ss,v 1.3 2004/09/27 05:58:55 don Exp $
16 use POSIX qw(strftime);
20 deletemailbox -- deletes a mailbox and the offlineimap information corresponding to that mailbox
27 --account, -a account (Default lists)
28 --debug, -d debugging level (Default 0)
29 --help, -h display this help
30 --man, -m display manual
36 =item B<--account, -a>
38 Name of the account from which the folder will be deleted
42 Debug verbosity. (Default 0)
46 Display brief useage information.
56 deletemailbox -a lists rnm-devel
64 # XXX parse config file
66 my %options = (debug => 0,
69 offlineimap => User->Home.'/.offlineimap',
70 maildir => User->Home.'/Mail',
74 GetOptions(\%options,'account|a=s','debug|d+','help|h|?','man|m');
76 pod2usage() if $options{help};
77 pod2usage({verbose=>2}) if $options{man};
79 $DEBUG = $options{debug};
82 for my $mbox (@ARGV) {
83 # Delete ~/.offlineimap/Repository-{Local,Remote}Lists/FolderValidity/mbox
84 # initialcaps account needed for the account name
85 my $cmd = qq(rm -f $options{offlineimap}/Repository-Local).
86 ucfirst($options{account}).
87 qq(/FolderValidity/$mbox;\n);
90 $cmd = qq(rm -f $options{offlineimap}/Repository-Remote).
91 ucfirst($options{account}).
92 qq(/FolderValidity/$options{account}.$mbox;\n);
95 # Delete ~/.offlineimap/Account-Lists/mbox
96 $cmd = qq(rm -f $options{offlineimap}/Account-).ucfirst($options{account}).
97 qq(/LocalStatus/$mbox;\n);
101 $cmd = qq(rm -rf $options{maildir}/$options{account}/$mbox;\n);