summaryrefslogtreecommitdiffstats
path: root/bin/kolab_smtp_access_policy.py
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:42 +0200
commit7f94b317ed08b4d62407e018e6057cc958872efa (patch)
tree5519ae201b97fdbb53de7075090eb612d42de6b7 /bin/kolab_smtp_access_policy.py
parent61e53980ae71511f4c538252a571e8cd54eb0712 (diff)
downloadpykolab-7f94b317ed08b4d62407e018e6057cc958872efa.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
Diffstat (limited to 'bin/kolab_smtp_access_policy.py')
-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