Merge ~hloeung/mailman3-core-charm:master into mailman3-core-charm:master

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: 426c3a7140700b4312f6e40114cfea737f153f2d
Merged at revision: e1d0e82266f817034de905e12c47dcd7d7874109
Proposed branch: ~hloeung/mailman3-core-charm:master
Merge into: mailman3-core-charm:master
Diff against target: 33 lines (+14/-0)
2 files modified
config.yaml (+8/-0)
reactive/mailman3_core.py (+6/-0)
Reviewer Review Type Date Requested Status
James Simpson Approve
Canonical IS Reviewers Pending
Review via email: mp+416995@code.launchpad.net

Commit message

Add support for specifying transport maps - LP:1965073

To post a comment you must log in.
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
James Simpson (jsimpso) wrote :

LGTM

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

Change successfully merged at revision e1d0e82266f817034de905e12c47dcd7d7874109

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/config.yaml b/config.yaml
index a2ebd27..0516192 100644
--- a/config.yaml
+++ b/config.yaml
@@ -97,3 +97,11 @@ options:
97 description: |97 description: |
98 A comma-separated list of nagios servicegroups.98 A comma-separated list of nagios servicegroups.
99 If left empty, the nagios_context will be used as the servicegroup99 If left empty, the nagios_context will be used as the servicegroup
100 transport_maps:
101 type: string
102 default: ''
103 description: |
104 Optional lookup tables with mappings from recipient address to
105 message delivery transport or next-hop destination.
106
107 http://www.postfix.org/postconf.5.html#transport_maps
diff --git a/reactive/mailman3_core.py b/reactive/mailman3_core.py
index dec185c..42453dd 100644
--- a/reactive/mailman3_core.py
+++ b/reactive/mailman3_core.py
@@ -105,6 +105,12 @@ def configure_postfix():
105 subprocess.check_output(['postconf', 'always_add_missing_headers=yes',105 subprocess.check_output(['postconf', 'always_add_missing_headers=yes',
106 'local_header_rewrite_clients=static:all'])106 'local_header_rewrite_clients=static:all'])
107107
108 transport_maps = config.get('transport_maps', '')
109 if transport_maps:
110 host.write_file('/etc/postfix/transport', transport_maps)
111 subprocess.check_output(['postmap', '/etc/postfix/transport'])
112 subprocess.check_output(['postconf', 'transport_maps=hash:/etc/postfix/transport'])
113
108 if config["enable_spamassassin"]:114 if config["enable_spamassassin"]:
109 configure_spamassassin()115 configure_spamassassin()
110 if config["enable_spf"]:116 if config["enable_spf"]:

Subscribers

People subscribed via source and target branches