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

Proposed by Haw Loeung
Status: Merged
Approved by: Benjamin Allot
Approved revision: 463d5a31e98544eb27bb6b14cc07655bf435a5d0
Merged at revision: 36f3623ef8edda6f6b547e4c6c425382a0ad5e6b
Proposed branch: ~hloeung/mailman3-core-charm:master
Merge into: mailman3-core-charm:master
Diff against target: 41 lines (+10/-7)
1 file modified
reactive/mailman3_core.py (+10/-7)
Reviewer Review Type Date Requested Status
Benjamin Allot Approve
Canonical IS Reviewers Pending
Review via email: mp+416999@code.launchpad.net

Commit message

Fixed preserving the transport required by mailman3

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
Benjamin Allot (ballot) wrote :

LGTM

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

Change successfully merged at revision 36f3623ef8edda6f6b547e4c6c425382a0ad5e6b

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/reactive/mailman3_core.py b/reactive/mailman3_core.py
2index 42453dd..da3c707 100644
3--- a/reactive/mailman3_core.py
4+++ b/reactive/mailman3_core.py
5@@ -89,9 +89,10 @@ def configure_postfix():
6 subprocess.check_output(['postconf', 'smtp_address_preference=ipv4', 'lmtp_address_preference=ipv4',
7 'default_transport=smtp', 'relay_transport=smtp',
8 'smtpd_relay_restrictions=permit_mynetworks defer_unauth_destination'])
9+ transports = []
10 if os.path.exists('/var/lib/mailman3/data/postfix_lmtp'):
11- subprocess.check_output(['postconf', 'transport_maps=hash:/var/lib/mailman3/data/postfix_lmtp',
12- 'relay_recipient_maps=hash:/var/lib/mailman3/data/postfix_lmtp',
13+ transports.append('hash:/var/lib/mailman3/data/postfix_lmtp')
14+ subprocess.check_output(['postconf', 'relay_recipient_maps=hash:/var/lib/mailman3/data/postfix_lmtp',
15 'local_recipient_maps=hash:/var/lib/mailman3/data/postfix_lmtp'])
16 subprocess.check_output(['postmap', '/var/lib/mailman3/data/postfix_lmtp'])
17 if os.path.exists('/var/lib/mailman3/data/postfix_domains'):
18@@ -100,16 +101,18 @@ def configure_postfix():
19
20 subprocess.check_output(['postconf', 'smtpd_sender_restrictions=reject_unknown_sender_domain'])
21
22+ transport_maps = config.get('transport_maps', '')
23+ if transport_maps:
24+ host.write_file('/etc/postfix/transport', transport_maps)
25+ subprocess.check_output(['postmap', '/etc/postfix/transport'])
26+ transports.append('hash:/etc/postfix/transport')
27+
28 # HyperKitty expects messages will all have the 'Message-ID' header,
29 # unfortunately not all clients do so let's work around it (LP: #1776658)
30 subprocess.check_output(['postconf', 'always_add_missing_headers=yes',
31 'local_header_rewrite_clients=static:all'])
32
33- transport_maps = config.get('transport_maps', '')
34- if transport_maps:
35- host.write_file('/etc/postfix/transport', transport_maps)
36- subprocess.check_output(['postmap', '/etc/postfix/transport'])
37- subprocess.check_output(['postconf', 'transport_maps=hash:/etc/postfix/transport'])
38+ subprocess.check_output(['postconf', 'transport_maps={}'.format(', '.join(transports))])
39
40 if config["enable_spamassassin"]:
41 configure_spamassassin()

Subscribers

People subscribed via source and target branches