summaryrefslogtreecommitdiff
path: root/bin/transfer_mailbox.pl
diff options
context:
space:
mode:
Diffstat (limited to 'bin/transfer_mailbox.pl')
-rwxr-xr-xbin/transfer_mailbox.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/transfer_mailbox.pl b/bin/transfer_mailbox.pl
new file mode 100755
index 0000000..0c3aedb
--- /dev/null
+++ b/bin/transfer_mailbox.pl
@@ -0,0 +1,18 @@
+#!/usr/bin/perl
+
+# Transfer a mailbox from one server to another.
+use Kolab;
+use Kolab::Cyrus;
+
+my $mailboxName = $ARGV[0];
+my $mailboxPreferredServer = $ARGV[1];
+
+if ( !$mailboxPreferredServer ) {
+ die("No target server specified");
+}
+
+Kolab::reloadConfig('/etc/kolab/kolab-shc.conf');
+
+my $rc = Kolab::cyrusMurderTransferMailbox($mailboxName, $mailboxPreferredServer);
+
+exit !$rc;