ispman/bin ispman.createMailbox, 1.5, 1.6 ispman.deleteMailbox, 1.5, 1.6 ispman.getMailboxQuota, 1.4, 1.5 ispman.listMailboxes, 1.4, 1.5 ispman.setMailboxQuota, 1.4, 1.5
Joerg Delker <[email protected]>
| Newsgroups | gmane.comp.isp.ispman.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14600/bin
Modified Files:
ispman.createMailbox ispman.deleteMailbox
ispman.getMailboxQuota ispman.listMailboxes
ispman.setMailboxQuota
Log Message:
refurbished mailbox cli tools
Index: ispman.setMailboxQuota
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.setMailboxQuota,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ispman.setMailboxQuota 30 May 2004 23:35:32 -0000 1.4
+++ ispman.setMailboxQuota 7 Sep 2006 21:00:50 -0000 1.5
@@ -3,17 +3,17 @@
use FindBin;
unshift @INC,
( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
- unless (@ARGV) {
+ use Getopt::Std;
+ getopt('h', \%opts);
+ unless ($opts{'h'}) {
$0 =~ s/.*\///;
- print "Usage: $0 -h host mailbox quota\n";
+ print "Usage: $0 -h imap_server mailbox quota\n";
exit;
}
}
-require "cyrusadmin.pm";
+require "mailbox_actions.lib";
-$mailbox = join "", ( $mailbox_prefix, $ARGV[0] );
-$quota = $ARGV[1];
-try( $imap->set_quota( $mailbox, $quota ) );
+my $err = set_quota( $opts{'h'}, $ARGV[0], $ARGV[1] );
-exit;
+exit $err;
Index: ispman.deleteMailbox
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.deleteMailbox,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ispman.deleteMailbox 15 Jun 2006 15:45:38 -0000 1.5
+++ ispman.deleteMailbox 7 Sep 2006 21:00:50 -0000 1.6
@@ -4,23 +4,25 @@
use FindBin;
unshift @INC,
( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
- unless (@ARGV) {
+ use Getopt::Std;
+ getopt('h', \%opts);
+ unless ($opts{'h'}) {
$0 =~ s/.*\///;
- print "Usage: $0 -h host mailbox [mailbox] [mailbox] .. [mailbox]\n";
+ print "Usage: $0 -h imap_server mailbox [mailbox] [mailbox] .. [mailbox]\n";
exit;
}
}
-require "cyrusadmin.pm";
-@mailboxes = @ARGV;
+require "mailbox_actions.lib";
-for $mailbox (@mailboxes) {
- $mailbox = "$mailbox_prefix$mailbox";
- try( $imap->set_acl( $mailbox, $admin, "lrswipdca" ) );
- try( $imap->delete($mailbox) );
+my @mailboxes = @ARGV;
+my $err = 0;
+
+for (@mailboxes) {
+ $err += delete_mailbox($opts{'h'}, email2uid($_));
}
-exit;
+exit $err;
__END__
Index: ispman.getMailboxQuota
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.getMailboxQuota,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ispman.getMailboxQuota 30 May 2004 23:35:32 -0000 1.4
+++ ispman.getMailboxQuota 7 Sep 2006 21:00:50 -0000 1.5
@@ -5,20 +5,21 @@
use FindBin;
unshift @INC,
( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
- unless (@ARGV) {
+ use Getopt::Std;
+ getopt('h', \%opts);
+ unless ($opts{'h'}) {
$0 =~ s/.*\///;
- print "Usage: $0 -h host mailbox [mailbox] [mailbox] .. [mailbox]\n";
+ print "Usage: $0 -h imap_server mailbox [mailbox] [mailbox] .. [mailbox]\n";
exit;
}
}
-require "cyrusadmin.pm";
+require "mailbox_actions.lib";
-@mailboxes = @ARGV;
+my @mailboxes = @ARGV;
for (@mailboxes) {
- $_ = "$mailbox_prefix$_";
- try( @q = $imap->get_quota($_) );
- print Dumper( \@q );
+ my @q = get_quota($opts{'h'},email2uid($_));
+ print join(",",@q)."\n" ;
}
exit;
Index: ispman.createMailbox
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.createMailbox,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ispman.createMailbox 30 May 2004 23:35:31 -0000 1.5
+++ ispman.createMailbox 7 Sep 2006 21:00:50 -0000 1.6
@@ -4,32 +4,27 @@
use FindBin;
unshift @INC,
( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
- unless (@ARGV) {
+ use Getopt::Std;
+ getopt('h', \%opts);
+ unless ($opts{'h'}) {
$0 =~ s/.*\///;
- print "Usage: $0 -h host mailbox [mailbox] [mailbox] .. [mailbox]\n";
+ print "Usage: $0 -h imap_server mailbox [mailbox] [mailbox] ... [mailbox]\n";
print "Example: $FindBin::Script -h localhost user_domain_tld\n";
print "Example: $FindBin::Script -h localhost user\@domain.tld\n";
exit;
}
}
-require "cyrusadmin.pm";
-use lib qw(%%installDir%%/lib);
+require "mailbox_actions.lib";
-@mailboxes = @ARGV;
+
+my @mailboxes = @ARGV;
+my $err = 0;
for (@mailboxes) {
- $mailbox = join '', ( $mailbox_prefix, email2uid($_) );
- try( $imap->create($mailbox) );
+ $err += create_mailbox($opts{'h'}, email2uid($_));
}
-sub email2uid {
- my $str = shift;
- ( $uid, $domain ) = split( '@', $str );
- if ($domain) {
- $domain =~ s/\./_/g;
- $str = join '_', ( $uid, $domain );
- }
- return $str;
-}
-exit;
+exit $err;
+
+__END__
Index: ispman.listMailboxes
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.listMailboxes,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- ispman.listMailboxes 30 May 2004 23:35:32 -0000 1.4
+++ ispman.listMailboxes 7 Sep 2006 21:00:50 -0000 1.5
@@ -3,15 +3,24 @@
use FindBin;
unshift @INC,
( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
+ use Getopt::Std;
+ getopt('h', \%opts);
+ unless ($opts{'h'}) {
+ $0 =~ s/.*\///;
+ print "Usage: $0 -h imap_server [filter]\n";
+ print "Example: $FindBin::Script -h localhost\n";
+ print "Example: $FindBin::Script -h localhost user.\*_example_com\n";
+ exit;
+ }
+
}
-$|++;
-require "cyrusadmin.pm";
-$mailboxes = $ARGV[0] || '*';
-@list = $imap->list($mailboxes);
-for (@list) {
- s/^$mailbox_prefix//;
+require "mailbox_actions.lib";
+
+my $filter = $ARGV[0] || '*';
+
+for (list_mailboxes($opts{'h'},$filter)) {
print "$_\n";
}
exit;
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642