diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-06-06 17:10:29 +0200 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-06-06 17:10:48 +0200 |
commit | 83b168527a91a6ebaf2b4c4dc0970bf3dd3941ec (patch) | |
tree | 92b847e6be8029900237aa0e0821d99528c009bd /bin | |
parent | c5c1b63e68f65b4999ad035dd168c5d530d949fe (diff) | |
download | pykolab-83b168527a91a6ebaf2b4c4dc0970bf3dd3941ec.tar.gz |
Accept recipients that are not LDAP entries (#829)
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/kolab_smtp_access_policy.py | 27 |
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 |