summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-06 17:10:29 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-06-06 17:10:48 +0200
commit83b168527a91a6ebaf2b4c4dc0970bf3dd3941ec (patch)
tree92b847e6be8029900237aa0e0821d99528c009bd /bin
parentc5c1b63e68f65b4999ad035dd168c5d530d949fe (diff)
downloadpykolab-83b168527a91a6ebaf2b4c4dc0970bf3dd3941ec.tar.gz
Accept recipients that are not LDAP entries (#829)
Diffstat (limited to 'bin')
-rwxr-xr-xbin/kolab_smtp_access_policy.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py
index d7019fe..d97690a 100755
--- a/bin/kolab_smtp_access_policy.py
+++ b/bin/kolab_smtp_access_policy.py
@@ -784,14 +784,27 @@ class PolicyRequest(object):
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")
- )
+ if isinstance(recipients, list):
+ if 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 len(recipients) == 1:
+ recipient = { 'dn': recipients[0] }
+ else:
+ log.debug(
+ _("Recipient address %r not found. Allowing since " + \
+ "the MTA was configured to accept the recipient.") % (
+ normalize_address(recipient)
+ ),
+ level=3
+ )
+
+ return True
- return True
elif isinstance(recipients, basestring):
recipient = {
'dn': recipients