summaryrefslogtreecommitdiff
path: root/bin/create_mailbox.pl
blob: efe28a0aaeeb58a254de30f19b799b6efdd87d57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/perl

# Create a new mailbox without a preference as to which server the mailbox is
# created on. To give the preferred mailbox server, set $mailboxPreferredServer
# to the server's Fully Qualified Domain Name.
use Kolab;
use Kolab::Cyrus;

my ($mailboxName, $mailboxPreferredServer, $mailboxType) = @ARGV;

Kolab::reloadConfig('/etc/kolab/kolab-shc.conf');

if ( !$mailboxType ) {
    $mailboxType = 'user';
}

if ( !$mailboxPreferredServer ) {
    $mailboxPreferredServer = 0;
}

my $mailboxServer = Kolab::cyrusMurderCreateMailbox($mailboxName, $mailboxPreferredServer, $mailboxType);

print $mailboxServer . "\n";