diff options
author | Thomas Arendsen Hein <thomas@intevation.de> | 2009-02-09 15:39:37 (GMT) |
---|---|---|
committer | Thomas Arendsen Hein <thomas@intevation.de> | 2009-02-09 15:39:37 (GMT) |
commit | a0c182431e480dfee7aff69b0c68ed50a220db3f (patch) | |
tree | 4becb2a7c46380684c4af5b7cbe3cff41d8840db | |
parent | 4cc314a3a7cec7068a0e48abb567270e57b0fb4b (diff) | |
download | perl-Kolab-a0c182431e480dfee7aff69b0c68ed50a220db3f.tar.gz |
Continue LDAP sync if connecting the IMAP server fails, just skip actions that would need it.
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | lib/Kolab/LDAP.pm | 22 |
2 files changed, 18 insertions, 6 deletions
@@ -2,6 +2,8 @@ * lib/Kolab/LDAP.pm: Create user mailbox on the kolabHomeServer only, if attribute kolabHomeServerOnly is true. + * lib/Kolab/LDAP.pm: Continue sync if connecting the IMAP server + fails, just skip actions that would need it. 2009-01-20 Mathieu Parent <math.parent@gmail.com> diff --git a/lib/Kolab/LDAP.pm b/lib/Kolab/LDAP.pm index 53de921..af87d6d 100644 --- a/lib/Kolab/LDAP.pm +++ b/lib/Kolab/LDAP.pm @@ -480,6 +480,11 @@ sub createObject $islocal = 0; } + if (!$cyrus) { + Kolab::log('L', 'object wants mailbox, but not connected to imap, returning', KOLAB_DEBUG); + return; + } + # Intermediate multidomain support: # We accept domain encoded in CN... if( $p eq 'sf' && index( $uid, '@' ) < 0 ) { @@ -616,6 +621,13 @@ sub deleteObject my $remfromldap = shift || 0; my $p = shift || 'user'; + my $guid = $object->get_value($Kolab::config{$p . '_field_guid'}); + my $uid = uidcacheFetch($guid); + if ($uid && !$cyrus) { + Kolab::log('L', 'object found in mboxcache, but not connected to imap, returning', KOLAB_DEBUG); + return; + } + if ($remfromldap) { my $dn = $object->dn; my $del = $object->get_value($Kolab::config{$p . '_field_deleted'}, asref => 1); @@ -697,8 +709,6 @@ sub deleteObject } } - my $guid = $object->get_value($Kolab::config{$p . '_field_guid'}); - my $uid = uidcacheFetch($guid); if (!$uid) { Kolab::log('L', 'Deleted object not found in mboxcache, returning', KOLAB_DEBUG); return; @@ -715,16 +725,16 @@ sub sync Kolab::log('L', 'Synchronising'); my $cyrus = Kolab::Cyrus::create; - if( !$cyrus ) { - # We could not connect, bail out for now - return 0; - } %newuid_db = (); $user_timestamp = syncBasic($cyrus, 'user', '', $user_timestamp, 0); $sf_timestamp = syncBasic($cyrus, 'sf', '', $sf_timestamp, 1); $group_timestamp = syncBasic($cyrus, 'group', '', $group_timestamp, 0); + if( !$cyrus ) { + # We could not connect, bail out for now + return 0; + } # Check that all mailboxes correspond to LDAP objects Kolab::log('L', 'Synchronising mailboxes'); |