wallace/module_invitationpolicy.py

Thomas Brüderli bruederli at kolabsys.com
Mon Mar 9 17:35:09 CET 2015


 wallace/module_invitationpolicy.py |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 694a8c0b2c4215c3c5a05022e7498aecf88da7ac
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Mon Mar 9 12:35:02 2015 -0400

    Only take delegated mailboxes into account when receiving iTip REPLY messages (#4798) as initially intened in commit e94e4e2

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]




More information about the commits mailing list