summaryrefslogtreecommitdiff
path: root/bin/rename_mailbox.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/rename_mailbox.pl')
-rwxr-xr-xbin/rename_mailbox.pl20
1 files changed, 20 insertions, 0 deletions
diff --git a/bin/rename_mailbox.pl b/bin/rename_mailbox.pl
new file mode 100755
index 0000000..796a726
--- /dev/null
+++ b/bin/rename_mailbox.pl
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+
+# Rename a mailbox.
+use Kolab;
+use Kolab::Cyrus;
+
+# Jane Gi marries John Doe
+my ($mailboxName, $newMailboxName, $mailboxType) = @ARGV;
+
+if ( ! $mailboxType ) {
+ $mailboxType = 'user';
+}
+
+if ( ! $newMailboxName ) {
+ die("Require the new mailbox name in a rename.");
+}
+
+Kolab::reloadConfig('/etc/kolab/kolab.conf');
+
+Kolab::cyrusMurderRenameMailbox($mailboxName, $newMailboxName, $mailboxType);