summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-03 18:36:54 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-03 18:36:54 +0200
commit17d2a7a45e536c449bed16a05ffe47de378eb01d (patch)
treefc5db45c949be629423239299a7442ed0cc7e4cc /bin
parent95b4cfc2aeec915c744739bbf362e16b2bd9cd40 (diff)
downloadpykolab-17d2a7a45e536c449bed16a05ffe47de378eb01d.tar.gz
Multiple recipient entries to be found associated with the recipient email address to result in the SMTP Access Policy not being applied. (#816)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/kolab_smtp_access_policy.py23
1 files changed, 17 insertions, 6 deletions
diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py
index ed1ce21..14aea56 100755
--- a/bin/kolab_smtp_access_policy.py
+++ b/bin/kolab_smtp_access_policy.py
@@ -731,12 +731,23 @@ class PolicyRequest(object):
return True
- recipient = {
- 'dn': auth.find_recipient(
- normalize_address(recipient),
- domain=sasl_domain,
- )
- }
+ recipients = auth.find_recipient(
+ normalize_address(recipient),
+ domain=sasl_domain,
+ )
+
+ if isinstance(recipients, list) and len(recipients) > 1:
+ log.info(
+ _("This recipient address is related to multiple " + \
+ "object entries and the SMTP Access Policy can " + \
+ "therefore not restrict message flow")
+ )
+
+ return True
+ elif isinstance(recipients, basestring):
+ recipient = {
+ 'dn': recipients
+ }
# We have gotten an invalid recipient. We need to catch this case,
# because testing can input invalid recipients, and so can faulty