summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-03-09 16:35:02 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2015-03-09 16:35:02 (GMT)
commit694a8c0b2c4215c3c5a05022e7498aecf88da7ac (patch)
treef4fd1554c3a0f4b5697316474f7931d3e4ab0f71
parent6f68887acae9fb817c59a707029f01562162e4aa (diff)
downloadpykolab-694a8c0b2c4215c3c5a05022e7498aecf88da7ac.tar.gz
Only take delegated mailboxes into account when receiving iTip REPLY messages (#4798) as initially intened in commit e94e4e2
-rw-r--r--wallace/module_invitationpolicy.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/wallace/module_invitationpolicy.py b/wallace/module_invitationpolicy.py
index d6503a0..72a4464 100644
--- a/wallace/module_invitationpolicy.py
+++ b/wallace/module_invitationpolicy.py
@@ -277,6 +277,9 @@ def execute(*args, **kw):
if any_itips and len([x['uid'] for x in itip_events if x.has_key('attendees') or x.has_key('organizer')]) > 0:
auth.connect()
+ # we're looking at the first itip object
+ itip_event = itip_events[0]
+
for recipient in recipients:
recipient_user_dn = user_dn_from_email_address(recipient)
if recipient_user_dn:
@@ -285,9 +288,11 @@ def execute(*args, **kw):
recipient_email = recipient
# extend with addresses from delegators
+ # (only do this lookup for REPLY messages)
receiving_user['_delegated_mailboxes'] = []
- for _delegator in auth.list_delegators(recipient_user_dn):
- receiving_user['_delegated_mailboxes'].append(_delegator['_mailbox_basename'].split('@')[0])
+ if itip_event['method'] == 'REPLY':
+ for _delegator in auth.list_delegators(recipient_user_dn):
+ receiving_user['_delegated_mailboxes'].append(_delegator['_mailbox_basename'].split('@')[0])
log.debug(_("Recipient emails for %s: %r") % (recipient_user_dn, recipient_emails), level=8)
break
@@ -299,9 +304,6 @@ def execute(*args, **kw):
log.debug(_("iTips, but no users, pass along %r") % (filepath), level=5)
return filepath
- # we're looking at the first itip object
- itip_event = itip_events[0]
-
# for replies, the organizer is the recipient
if itip_event['method'] == 'REPLY':
organizer_mailto = str(itip_event['organizer']).split(':')[-1]