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
diff --git a/reactive/mailman3_core.py b/reactive/mailman3_core.py
index 42453dd..da3c707 100644
--- a/reactive/mailman3_core.py
+++ b/reactive/mailman3_core.py
@@ -89,9 +89,10 @@ def configure_postfix():
89 subprocess.check_output(['postconf', 'smtp_address_preference=ipv4', 'lmtp_address_preference=ipv4',89 subprocess.check_output(['postconf', 'smtp_address_preference=ipv4', 'lmtp_address_preference=ipv4',
90 'default_transport=smtp', 'relay_transport=smtp',90 'default_transport=smtp', 'relay_transport=smtp',
91 'smtpd_relay_restrictions=permit_mynetworks defer_unauth_destination'])91 'smtpd_relay_restrictions=permit_mynetworks defer_unauth_destination'])
92 transports = []
92 if os.path.exists('/var/lib/mailman3/data/postfix_lmtp'):93 if os.path.exists('/var/lib/mailman3/data/postfix_lmtp'):
93 subprocess.check_output(['postconf', 'transport_maps=hash:/var/lib/mailman3/data/postfix_lmtp',94 transports.append('hash:/var/lib/mailman3/data/postfix_lmtp')
94 'relay_recipient_maps=hash:/var/lib/mailman3/data/postfix_lmtp',95 subprocess.check_output(['postconf', 'relay_recipient_maps=hash:/var/lib/mailman3/data/postfix_lmtp',
95 'local_recipient_maps=hash:/var/lib/mailman3/data/postfix_lmtp'])96 'local_recipient_maps=hash:/var/lib/mailman3/data/postfix_lmtp'])
96 subprocess.check_output(['postmap', '/var/lib/mailman3/data/postfix_lmtp'])97 subprocess.check_output(['postmap', '/var/lib/mailman3/data/postfix_lmtp'])
97 if os.path.exists('/var/lib/mailman3/data/postfix_domains'):98 if os.path.exists('/var/lib/mailman3/data/postfix_domains'):
@@ -100,16 +101,18 @@ def configure_postfix():
100101
101 subprocess.check_output(['postconf', 'smtpd_sender_restrictions=reject_unknown_sender_domain'])102 subprocess.check_output(['postconf', 'smtpd_sender_restrictions=reject_unknown_sender_domain'])
102103
104 transport_maps = config.get('transport_maps', '')
105 if transport_maps:
106 host.write_file('/etc/postfix/transport', transport_maps)
107 subprocess.check_output(['postmap', '/etc/postfix/transport'])
108 transports.append('hash:/etc/postfix/transport')
109
103 # HyperKitty expects messages will all have the 'Message-ID' header,110 # HyperKitty expects messages will all have the 'Message-ID' header,
104 # unfortunately not all clients do so let's work around it (LP: #1776658)111 # unfortunately not all clients do so let's work around it (LP: #1776658)
105 subprocess.check_output(['postconf', 'always_add_missing_headers=yes',112 subprocess.check_output(['postconf', 'always_add_missing_headers=yes',
106 'local_header_rewrite_clients=static:all'])113 'local_header_rewrite_clients=static:all'])
107114
108 transport_maps = config.get('transport_maps', '')115 subprocess.check_output(['postconf', 'transport_maps={}'.format(', '.join(transports))])
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'])
113116
114 if config["enable_spamassassin"]:117 if config["enable_spamassassin"]:
115 configure_spamassassin()118 configure_spamassassin()

Subscribers

People subscribed via source and target branches