Merge ~kotodama/mailman3-core-charm/+git/mailman3-core-charm:sa-update-http-proxy into mailman3-core-charm:master

Proposed by Loïc Gomez
Status: Merged
Approved by: Romain Couturat
Approved revision: 2ee8f2858b19c5d4fcbe48d7ba7f7a8f50dbb0bd
Merged at revision: 50182b0cf8b38c29c764b2510ad8ec1f523357fe
Proposed branch: ~kotodama/mailman3-core-charm/+git/mailman3-core-charm:sa-update-http-proxy
Merge into: mailman3-core-charm:master
Diff against target: 36 lines (+14/-0)
2 files modified
config.yaml (+10/-0)
reactive/mailman3_core.py (+4/-0)
Reviewer Review Type Date Requested Status
Romain Couturat (community) Approve
Canonical IS Reviewers Pending
Review via email: mp+408403@code.launchpad.net

Commit message

Add sa_http_proxy option to allow sa-update cronjob to run through a proxy.

To post a comment you must log in.
Revision history for this message
Romain Couturat (romaincout) wrote :

lgtm

review: Approve
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 50182b0cf8b38c29c764b2510ad8ec1f523357fe

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/config.yaml b/config.yaml
2index 61aefd4..a2ebd27 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -35,6 +35,16 @@ options:
6 type: boolean
7 description: |
8 Enable Spamassassin mail filter
9+ sa_http_proxy:
10+ default: ""
11+ type: string
12+ description: |
13+ Define a http(s) proxy in /etc/default/spamassassin
14+
15+ This will add http_proxy and https_proxy environment variables in Spamassassin's /etc/default file
16+ and allow sa-update cronjob to update rulesets though a http(s)_proxy.
17+
18+ A valid entry would be http://proxy.host.name:3128
19 enable_spf:
20 default: true
21 type: boolean
22diff --git a/reactive/mailman3_core.py b/reactive/mailman3_core.py
23index 081cdcb..dec185c 100644
24--- a/reactive/mailman3_core.py
25+++ b/reactive/mailman3_core.py
26@@ -158,6 +158,10 @@ def configure_spamassassin():
27 default_config = ('ENABLED=0\n'
28 'OPTIONS="--create-prefs --max-children 5 --username spamd --helper-home-dir /var/lib/spamd -s /var/log/spamd.log"\n'
29 'CRON=1\n')
30+ if config["sa_http_proxy"]:
31+ default_config += 'http_proxy="' + config["sa_http_proxy"] + '"\n'
32+ default_config += 'https_proxy="' + config["sa_http_proxy"] + '"\n'
33+
34 sa_policy = config["spamassassin_policy"]
35 render(source="sa-local.cf.tmpl",
36 target="/etc/spamassassin/local.cf",

Subscribers

People subscribed via source and target branches