diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-05-02 18:51:53 (GMT) |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2011-05-02 18:51:53 (GMT) |
commit | 904e3a168a7446719e3d4f17e39843a8812ca7df (patch) | |
tree | 761c801283b7881348b6c97b6af33b6a12b723b7 | |
parent | 91ab8dde621c3f7e737b8a050fb2f3868575bb35 (diff) | |
download | perl-Kolab-904e3a168a7446719e3d4f17e39843a8812ca7df.tar.gz |
Update Kolab's logic to determine whether or not to create the mailbox on the local server
-rw-r--r-- | lib/Kolab/LDAP.pm | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/lib/Kolab/LDAP.pm b/lib/Kolab/LDAP.pm index 588a33f..9afb410 100644 --- a/lib/Kolab/LDAP.pm +++ b/lib/Kolab/LDAP.pm @@ -468,24 +468,31 @@ sub createObject return; } - if (($kolabhomeserver && $kolabhomeserver ne lc($Kolab::config{'fqdnhostname'}))) { - # We are not on the home server - if( $p eq 'sf' ) { - # Dont create shared folders on other hosts than it's kolabhomeserver - Kolab::log('L', "Kolab::LDAP::createObject() skipping shared folder for other server $kolabhomeserver", KOLAB_DEBUG); + if ((!$kolabhomeserver) || lc($kolabhomeserver) ne lc($Kolab::config{'fqdnhostname'})) { + # kolabHomeServer (or equivalent attribute) is not set, OR + # kolabHomeServer (or equiv. attr.) does not match our configured FQDN, and so + # whether or not we will create the object depends on whether the object has + # the 'kolabHomeServerOnly' attribute available and set to 'true'. + # + my $kolabhomeserveronly = $object->get_value('kolabhomeserveronly') || 0; + + if ($kolabhomeserveronly) { + # If 'kolabHomeServerOnly' is set to true, but we are not 'kolabHomeServer', + # then ignore. return; - } - my $kolabhomeserveronly = $object->get_value('kolabhomeserveronly'); - if( defined($kolabhomeserveronly) && $kolabhomeserveronly eq 'true' ) { - # Don't create the user's mailbox if it should be created on the kolabHomeServer only - Kolab::log('L', "Kolab::LDAP::createObject() skipping user mailbox creation for other server $kolabhomeserver", KOLAB_DEBUG); + } else { + # Otherwise, do create. + # + # TODO: + # + # - Once the mailbox is created, set the 'kolabHomeServer' or equivalent attribute to + # this server, so mail routing actually ends up with this server. return; } - Kolab::log('L', "Kolab::LDAP::createObject() for other server than $kolabhomeserver. TODO: Create referral or something, for now we just create an empty INBOX", KOLAB_DEBUG); - # We create INBOX on other servers also, to allow access to shared/published - # folders on those servers because some IMAP clients abort the connection - # to an IMAP server if they cannot access the INBOX. - $islocal = 0; + } else { + # kolabHomeServer or equivalent attribute *IS* set, OR + # kolabHomeServer does match our (configured) FQDN. + # If so, be happy and smile to the camera. } if (!$cyrus) { |