Merge postfix configurations and use conditionals

This commit is contained in:
decentral1se 2021-05-23 23:26:26 +02:00
parent 9b9f355ff9
commit 2df37e7676
No known key found for this signature in database
GPG Key ID: 92DAD76BD9567B8A
4 changed files with 10 additions and 8 deletions

View File

@ -151,6 +151,7 @@ DB_FLAVOR=sqlite
# Mailman settings
###################################
# COMPOSE_FILE="compose.yml:compose.mailman.yml"
# MAILMAN_POSTFIX_OVERRIDES=1
# MAILMAN_CORE_VOLUME=lists_example_com_mailman-core
# MAILMAN_CORE_NETWORK=lists_example_com_internal
@ -161,3 +162,4 @@ DB_FLAVOR=sqlite
# there is an open ticket with a further discussion also https://github.com/Mailu/Mailu/issues/1096
###################################
# COMPOSE_FILE="compose.yml:compose.mailfrom.yml"
# SENDER_LOGINS_POSTFIX_OVERRIDES=1

View File

@ -3,15 +3,10 @@ version: "3.6"
services:
smtp:
configs:
- source: mailfrom_overrides
target: /overrides/postfix.cf
- source: sender_logins
target: /overrides/sender_logins
configs:
mailfrom_overrides:
name: ${STACK_NAME}_mailfrom_overrides_${POSTFIX_OVERRIDE_VERSION}
file: postfix.mailfrom.cf
sender_logins:
name: ${STACK_NAME}_sender_logins_${SENDER_LOGIN_VERSIONS}
file: sender_logins

View File

@ -2,6 +2,7 @@
# https://mailu.io/1.7/faq.html?highlight=override#how-can-i-override-settings
# https://github.com/Mailu/Mailu/blob/master/core/postfix/conf/main.cf
{{ if eq (env "MAILMAN_POSTFIX_OVERRIDES") "1" }}
# Please note, this config assumes "recipient_delimiter = +" in the main.cf
# and transport_maps/relay_domains preserve the overriden postfix.cf config values
# and finally, we use single lines configuration definitions because:
@ -12,3 +13,10 @@ owner_request_special = no
transport_maps = regexp:/opt/mailman/var/data/postfix_lmtp \${podop}transport
local_recipient_maps = regexp:/opt/mailman/var/data/postfix_lmtp
relay_domains = regexp:/opt/mailman/var/data/postfix_domains \${podop}transport
{{ end }}
{{ if eq (env "SENDER_LOGINS_POSTFIX_OVERRIDES") "1" }}
# https://github.com/Mailu/Mailu/issues/1096
smtpd_sender_login_maps = unionmap:{${podop}senderlogin, pcre:/overrides/sender_logins}
{{ end }}

View File

@ -1,3 +0,0 @@
# https://github.com/Mailu/Mailu/issues/1096
smtpd_sender_login_maps = unionmap:{${podop}senderlogin, pcre:/overrides/sender_logins}