Changeset View
Changeset View
Standalone View
Standalone View
pykolab/cli/cmd_sync.py
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | def _synchronize(*args, **kw): | ||||
if not 'kolabinetorgperson' in entry['objectclass']: | if not 'kolabinetorgperson' in entry['objectclass']: | ||||
return | return | ||||
imap = IMAP() | imap = IMAP() | ||||
imap.connect() | imap.connect() | ||||
if not imap.user_mailbox_exists(entry[mailbox_attribute]): | if not imap.user_mailbox_exists(entry[mailbox_attribute]): | ||||
if entry.has_key('mailhost'): | if 'mailhost' in entry: | ||||
server = entry['mailhost'] | server = entry['mailhost'] | ||||
else: | else: | ||||
server = None | server = None | ||||
imap.user_mailbox_create(entry[mailbox_attribute], server=server) | imap.user_mailbox_create(entry[mailbox_attribute], server=server) | ||||
imap.disconnect() | imap.disconnect() | ||||