diff --git a/.env.sample b/.env.sample index e3c1fd5..ad1a83a 100644 --- a/.env.sample +++ b/.env.sample @@ -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 diff --git a/compose.mailfrom.yml b/compose.senderlogins.yml similarity index 54% rename from compose.mailfrom.yml rename to compose.senderlogins.yml index a41fbfe..2895257 100644 --- a/compose.mailfrom.yml +++ b/compose.senderlogins.yml @@ -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 diff --git a/postfix.mailman.cf b/postfix.cf similarity index 76% rename from postfix.mailman.cf rename to postfix.cf index fffe19e..862970a 100644 --- a/postfix.mailman.cf +++ b/postfix.cf @@ -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 }} diff --git a/postfix.mailfrom.cf b/postfix.mailfrom.cf deleted file mode 100644 index f540352..0000000 --- a/postfix.mailfrom.cf +++ /dev/null @@ -1,3 +0,0 @@ -# https://github.com/Mailu/Mailu/issues/1096 - -smtpd_sender_login_maps = unionmap:{${podop}senderlogin, pcre:/overrides/sender_logins}