summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-11-25 17:30:11 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2013-11-25 17:30:11 +0100
commit98a10773fecb7db035158fdb3ec3690362eb4a16 (patch)
treed99ff3e9977015b72d799ac2f01cda74517d3fd4 /bin
parent16df2c27cf3fc7218621648c20febaa32f26c3ac (diff)
downloadpykolab-98a10773fecb7db035158fdb3ec3690362eb4a16.tar.gz
Add an option to disable adding Sender: and X-Sender: headers
Diffstat (limited to 'bin')
-rwxr-xr-xbin/kolab_smtp_access_policy.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/bin/kolab_smtp_access_policy.py b/bin/kolab_smtp_access_policy.py
index ed588c2..304ab85 100755
--- a/bin/kolab_smtp_access_policy.py
+++ b/bin/kolab_smtp_access_policy.py
@@ -1332,10 +1332,17 @@ def hold(message, policy_request=None):
def permit(message, policy_request=None):
log.info(_("Returning action PERMIT: %s") % (message))
+
if hasattr(policy_request, 'sasl_username'):
- print "action=PREPEND Sender: %s\naction=PERMIT\n\n" % (policy_request.sasl_username)
- else:
- print "action=PERMIT\n\n"
+ sender = conf.get('kolab_smtp_access_policy', 'sender_header')
+ if utils.true_or_false(sender):
+ print "action=PREPEND Sender: %s" % (policy_request.sasl_username)
+
+ xsender = conf.get('kolab_smtp_access_policy', 'xsender_header')
+ if utils.true_or_false(xsender):
+ print "action=PREPEND X-Sender: %s" % (policy_request.sasl_username)
+
+ print "action=PERMIT\n\n"
sys.exit(0)
def reject(message, policy_request=None):