summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-09-12 15:08:01 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2011-09-12 15:08:01 (GMT)
commit5fd48d99789956abfc7bf1f72c5ab69357f19f01 (patch)
treed6ab3b7363834a20d0c638da57c865fb8bbe60a5
parent9eb9bfcbbdcc38681cf706be140debb3ba016d42 (diff)
downloadpykolab-5fd48d99789956abfc7bf1f72c5ab69357f19f01.tar.gz
Make sure the sender exists before continuing
-rwxr-xr-xbin/kolab_smtp_access_policy.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py
index 033b550..74981a7 100755
--- a/bin/kolab_smtp_access_policy.py
+++ b/bin/kolab_smtp_access_policy.py
@@ -606,6 +606,14 @@ def verify_sender(policy_request):
)
}
+ if not sender_user['dn']:
+ if conf.allow_unauthenticated:
+ return True
+ else:
+ policy_done = True
+ reject(_("Not allowing unauthenticated users, but sender not found"))
+ return False
+
log.debug(_("Found user object %(dn)s") %(sender_user), level=8)
# Only when a user is authenticated do we have the means to check for