summaryrefslogtreecommitdiff
path: root/lib/Kolab/Cyrus.pm
diff options
context:
space:
mode:
authorThomas Arendsen Hein <thomas@intevation.de>2009-03-16 17:17:35 (GMT)
committerThomas Arendsen Hein <thomas@intevation.de>2009-03-16 17:17:35 (GMT)
commit0af8aa6851634d07afd6e30083f805fd493a46b4 (patch)
tree01fe3f8e92797e0b980476627e57613b05f0ae1d /lib/Kolab/Cyrus.pm
parent65bb9c810ab8639624e9f5b9e880fa7d4e19c53c (diff)
downloadperl-Kolab-0af8aa6851634d07afd6e30083f805fd493a46b4.tar.gz
Select random imap partition when creating new user mailboxes.
The behavior can be modified by setting a different imappartitions_script in kolab.conf or disabled by setting imappartitions_script to an empty value.
Diffstat (limited to 'lib/Kolab/Cyrus.pm')
-rw-r--r--lib/Kolab/Cyrus.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Kolab/Cyrus.pm b/lib/Kolab/Cyrus.pm
index 339f85c..647ba98 100644
--- a/lib/Kolab/Cyrus.pm
+++ b/lib/Kolab/Cyrus.pm
@@ -96,12 +96,13 @@ sub createMailbox
my $cyrus = shift;
my $uid = shift;
my $sf = shift || 0;
- my $cyruid = &createUid($uid, $sf);
+ my $partition = shift || '';
+ my $cyruid = &createUid($uid, $sf);
my $mailbox = ($cyrus->list($cyruid))[0];
if ($uid && ($uid ne $Kolab::config{'cyrus_admin'}) && ($uid ne "freebusy") && ($uid ne "nobody") && !defined($mailbox)) {
- Kolab::log('Y', "Creating mailbox `$cyruid'");
- if (!$cyrus->create($cyruid)) {
+ Kolab::log('Y', "Creating mailbox `$cyruid' on ".($partition?"partition `$partition'":"default partition"));
+ if (!$cyrus->create($cyruid, $partition)) {
Kolab::log('Y', "Unable to create mailbox `$cyruid', Error = `" . $cyrus->error . "'", KOLAB_WARN);
}
} else {