summaryrefslogtreecommitdiffstats
path: root/wallace/module_resources.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-03-04 13:23:50 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-03-04 13:23:50 +0100
commitaff739d30fb9eb530aaf9949bf0ede61cbe25860 (patch)
treefa0e41a97bb14d72c5e0b83acba57812383e4b33 /wallace/module_resources.py
parentf288329dde656601a671234e0674fe33b5fbb98b (diff)
downloadpykolab-aff739d30fb9eb530aaf9949bf0ede61cbe25860.tar.gz
Skip checking for resource (collection) records for recipients not in local domains
Diffstat (limited to 'wallace/module_resources.py')
-rw-r--r--wallace/module_resources.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index b718ac4..e089c41 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -126,7 +126,7 @@ def execute(*args, **kw):
)
)
- return
+ return filepath
else:
# Move to incoming
new_filepath = os.path.join(
@@ -186,19 +186,17 @@ def execute(*args, **kw):
if not any_itips:
log.debug(_("Not an iTip message, but sent to resource nonetheless. Reject message"), level=5)
reject(filepath)
- return
+ return False
else:
# Continue. Resources and iTips. We like.
pass
else:
if not any_itips:
log.debug(_("No itips, no resources, pass along"), level=5)
- accept(filepath)
- return
+ return filepath
else:
log.debug(_("iTips, but no resources, pass along"), level=5)
- accept(filepath)
- return
+ return filepath
# A simple list of merely resource entry IDs that hold any relevance to the
# iTip events
@@ -672,6 +670,14 @@ def resource_record_from_email_address(email_address):
resource_records = []
+ local_domains = auth.list_domains()
+
+ if not local_domains == None:
+ local_domains = list(set(local_domains.keys()))
+
+ if not email_address.split('@')[1] in local_domains:
+ return []
+
log.debug(
_("Checking if email address %r belongs to a resource (collection)") % (email_address),
level=8