From 4a8f312a2b6a92ce4ec82b6221a3ff272e6fa2e7 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Sun, 23 May 2021 23:12:42 +0200 Subject: [PATCH] Add mail from override configuration --- .env.sample | 8 ++++++++ abra.sh | 1 + compose.mailfrom.yml | 17 +++++++++++++++++ postfix.mailfrom.cf | 3 +++ 4 files changed, 29 insertions(+) create mode 100644 compose.mailfrom.yml create mode 100644 postfix.mailfrom.cf diff --git a/.env.sample b/.env.sample index f9dbe1f..e3c1fd5 100644 --- a/.env.sample +++ b/.env.sample @@ -153,3 +153,11 @@ DB_FLAVOR=sqlite # COMPOSE_FILE="compose.yml:compose.mailman.yml" # MAILMAN_CORE_VOLUME=lists_example_com_mailman-core # MAILMAN_CORE_NETWORK=lists_example_com_internal + +################################### +# SASL account -> MAIL FROM mappings for more liberal MAIL FROM relaying +# return-path: https://www.rubydoc.info/gems/actionmailer-rack-upgrade-2/2.3.15/ActionMailer/Base +# logins and MAIL FROM ownership: http://www.postfix.com/postconf.5.html#smtpd_relay_restrictions +# there is an open ticket with a further discussion also https://github.com/Mailu/Mailu/issues/1096 +################################### +# COMPOSE_FILE="compose.yml:compose.mailfrom.yml" diff --git a/abra.sh b/abra.sh index 8655eaa..83d77ed 100644 --- a/abra.sh +++ b/abra.sh @@ -1,2 +1,3 @@ export CERTDUMPER_POST_VERSION=v1 export POSTFIX_OVERRIDE_VERSION=v10 +export SENDER_LOGIN_VERSIONS=v1 diff --git a/compose.mailfrom.yml b/compose.mailfrom.yml new file mode 100644 index 0000000..a41fbfe --- /dev/null +++ b/compose.mailfrom.yml @@ -0,0 +1,17 @@ +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.mailfrom.cf b/postfix.mailfrom.cf new file mode 100644 index 0000000..f540352 --- /dev/null +++ b/postfix.mailfrom.cf @@ -0,0 +1,3 @@ +# https://github.com/Mailu/Mailu/issues/1096 + +smtpd_sender_login_maps = unionmap:{${podop}senderlogin, pcre:/overrides/sender_logins}