summaryrefslogtreecommitdiff
path: root/bin/rename_mailbox.pl
blob: 796a726684acc49c7e2af4d365f51a8d3e1284de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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);