diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-06-03 18:36:54 +0200 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2012-06-03 18:38:38 +0200 |
commit | f66e8f9a9d1a5f1a620f450c4c1f1c109d5747d7 (patch) | |
tree | 7e5d2bcf9e5ac3118d4e49bf2450019319a1a286 /bin | |
parent | d8665844e86329e4f0db2fdb4fafe4335328bcfd (diff) | |
download | pykolab-f66e8f9a9d1a5f1a620f450c4c1f1c109d5747d7.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-x | bin/kolab_smtp_access_policy.py | 23 |
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 |