summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-05-04 16:16:42 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-05-04 16:16:51 +0200
commita7d94ebb80d4f83b7601ed669a2e2aa2122239ea (patch)
treef66f06fbe890e64326e87fe9bd17a4c7dc51a046
parent32a4050673f8b91d6aa11d4cf9df5dee27b5b2e7 (diff)
downloadpykolab-a7d94ebb80d4f83b7601ed669a2e2aa2122239ea.tar.gz
Allow NULL sender in smtp_access_policy result cache (#5306)
Summary: Fixes #5306 Reviewers: #pykolab_developers Differential Revision: https://git.kolab.org/D140
-rwxr-xr-xbin/kolab_smtp_access_policy.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py
index 0b96644..bf5ec1c 100755
--- a/bin/kolab_smtp_access_policy.py
+++ b/bin/kolab_smtp_access_policy.py
@@ -88,7 +88,7 @@ policy_result_table = Table(
Column('id', Integer, Sequence('seq_id_result'), primary_key=True),
Column('key', String(16), nullable=False),
Column('value', Boolean, nullable=False),
- Column('sender', String(64), nullable=False),
+ Column('sender', String(64), nullable=True),
Column('recipient', String(64), nullable=False),
Column('sasl_username', String(64)),
Column('sasl_sender', String(64)),
@@ -377,7 +377,7 @@ class PolicyRequest(object):
for rule in rules['allow']:
deny_override = False
- if _object.endswith(rule):
+ if _object is not None and _object.endswith(rule):
for deny_rule in rules['deny']:
if deny_rule.endswith(rule):
deny_override = True
@@ -389,7 +389,7 @@ class PolicyRequest(object):
for rule in rules['deny']:
allow_override = False
- if _object.endswith(rule):
+ if _object is not None and _object.endswith(rule):
if not allowed:
denied = True
continue