diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2013-11-25 17:30:11 +0100 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2013-11-25 17:30:11 +0100 |
commit | 98a10773fecb7db035158fdb3ec3690362eb4a16 (patch) | |
tree | d99ff3e9977015b72d799ac2f01cda74517d3fd4 | |
parent | 16df2c27cf3fc7218621648c20febaa32f26c3ac (diff) | |
download | pykolab-98a10773fecb7db035158fdb3ec3690362eb4a16.tar.gz |
Add an option to disable adding Sender: and X-Sender: headers
-rwxr-xr-x | bin/kolab_smtp_access_policy.py | 13 | ||||
-rw-r--r-- | conf/kolab.conf | 10 |
2 files changed, 20 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): diff --git a/conf/kolab.conf b/conf/kolab.conf index 9764f2a..0abe802 100644 --- a/conf/kolab.conf +++ b/conf/kolab.conf @@ -268,8 +268,18 @@ auth_attributes = mail, alias, uid [kolab_smtp_access_policy] cache_uri = mysql://user:pass@localhost/database cache_retention = 86400 + +; To allow users to also send using email addresses in domain name spaces not +; in their own parent and/or alias domains, add 'mailalternateaddress' to this +; list. address_search_attrs = mail, alias +; Prepend the Sender: header? +sender_header = True + +; Prepend the X-Sender: header? +xsender_header = True + ; Allow hosts in these networks to submit messages with empty envelope senders, ; such as web-clients responding to MDN requests. empty_sender_hosts = 3.2.1.0/24, 6.6.6.0/24 |