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
1diff --git a/config.yaml b/config.yaml
2index a2ebd27..0516192 100644
3--- a/config.yaml
4+++ b/config.yaml
5@@ -97,3 +97,11 @@ options:
6 description: |
7 A comma-separated list of nagios servicegroups.
8 If left empty, the nagios_context will be used as the servicegroup
9+ transport_maps:
10+ type: string
11+ default: ''
12+ description: |
13+ Optional lookup tables with mappings from recipient address to
14+ message delivery transport or next-hop destination.
15+
16+ http://www.postfix.org/postconf.5.html#transport_maps
17diff --git a/reactive/mailman3_core.py b/reactive/mailman3_core.py
18index dec185c..42453dd 100644
19--- a/reactive/mailman3_core.py
20+++ b/reactive/mailman3_core.py
21@@ -105,6 +105,12 @@ def configure_postfix():
22 subprocess.check_output(['postconf', 'always_add_missing_headers=yes',
23 'local_header_rewrite_clients=static:all'])
24
25+ transport_maps = config.get('transport_maps', '')
26+ if transport_maps:
27+ host.write_file('/etc/postfix/transport', transport_maps)
28+ subprocess.check_output(['postmap', '/etc/postfix/transport'])
29+ subprocess.check_output(['postconf', 'transport_maps=hash:/etc/postfix/transport'])
30+
31 if config["enable_spamassassin"]:
32 configure_spamassassin()
33 if config["enable_spf"]:

Subscribers

People subscribed via source and target branches