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:11:05 +0200
commitad123156c3e279783a9c132e1382bfa53def12a4 (patch)
tree4a82d5f7c223cb1914733e8e423820191a535262 /bin
parented2cc117d6d00804d79434991a589b09bac34f07 (diff)
downloadpykolab-ad123156c3e279783a9c132e1382bfa53def12a4.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