summaryrefslogtreecommitdiffstats
path: root/bin/kolab_smtp_access_policy.py
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-11-23 07:54:44 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-11-23 07:54:44 +0100
commit953f35b331e9c613eecb4a04a713abd982d2cdd0 (patch)
treea56380267544fa46ec43ee944cfda2886282d88b /bin/kolab_smtp_access_policy.py
parent5b349dbbb9c1d41d9bb01e477f77b13542dc0a8c (diff)
downloadpykolab-953f35b331e9c613eecb4a04a713abd982d2cdd0.tar.gz
Lowercase rules and sender/recipient addresses when parsing the policy, or the policy values may not match the input values.
It is safe to lowercase both as exploiting case-sensitivity in mail address local parts or domain name spaces is not allowed. Demo Python code: >>> address = "Jeroen.vanMeeuwen@kolab.org" >>> address.startswith('jeroen') False Solves #496.
Diffstat (limited to 'bin/kolab_smtp_access_policy.py')
-rwxr-xr-xbin/kolab_smtp_access_policy.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py
index 2961f16..5005455 100755
--- a/bin/kolab_smtp_access_policy.py
+++ b/bin/kolab_smtp_access_policy.py
@@ -332,6 +332,9 @@ class PolicyRequest(object):
continue
+ # Lower-case the rule
+ rule = rule.lower()
+
# Also note the '-' cannot be passed on to the functions that
# follow, so store the rule separately from the prefix that is
# prepended to deny rules.