From cc17962c86fdbd9e16fae4b5f5e613021bccc626 Mon Sep 17 00:00:00 2001 From: ofthesun9 Date: Thu, 4 Oct 2018 17:25:22 +0000 Subject: [PATCH 1/3] fixes #583 --- core/postfix/conf/master.cf | 1 + 1 file changed, 1 insertion(+) diff --git a/core/postfix/conf/master.cf b/core/postfix/conf/master.cf index cbcc5e56..aa1e967a 100644 --- a/core/postfix/conf/master.cf +++ b/core/postfix/conf/master.cf @@ -8,6 +8,7 @@ smtp inet n - n - - smtpd 10025 inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_recipient_restrictions=reject_unlisted_sender,reject_authenticated_sender_login_mismatch,permit + -o smtpd_reject_unlisted_recipient={{ REJECT_UNLISTED_RECIPIENT }} -o cleanup_service_name=outclean outclean unix n - n - 0 cleanup -o header_checks=pcre:/etc/postfix/outclean_header_filter.cf From 09d77bc2de8b639b1c655b18c290314297836345 Mon Sep 17 00:00:00 2001 From: ofthesun9 Date: Thu, 4 Oct 2018 18:31:04 +0000 Subject: [PATCH 2/3] Handle the case where the variable REJECT_UNLISTED_RECIPIENT is not set --- core/postfix/conf/master.cf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/postfix/conf/master.cf b/core/postfix/conf/master.cf index aa1e967a..15fd62dc 100644 --- a/core/postfix/conf/master.cf +++ b/core/postfix/conf/master.cf @@ -8,7 +8,7 @@ smtp inet n - n - - smtpd 10025 inet n - n - - smtpd -o smtpd_sasl_auth_enable=yes -o smtpd_recipient_restrictions=reject_unlisted_sender,reject_authenticated_sender_login_mismatch,permit - -o smtpd_reject_unlisted_recipient={{ REJECT_UNLISTED_RECIPIENT }} + -o smtpd_reject_unlisted_recipient={% if REJECT_UNLISTED_RECIPIENT %}{{ REJECT_UNLISTED_RECIPIENT }}{% else %}no{% endif %} -o cleanup_service_name=outclean outclean unix n - n - 0 cleanup -o header_checks=pcre:/etc/postfix/outclean_header_filter.cf From 58a83a93e6599c1b0c090bb2bc237f37d2b10f1d Mon Sep 17 00:00:00 2001 From: ofthesun9 Date: Thu, 4 Oct 2018 18:44:27 +0000 Subject: [PATCH 3/3] Add REJECT_UNLISTED_RECIPIENT variable in .env file --- docs/compose/.env | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/compose/.env b/docs/compose/.env index 9477448a..721aaf22 100644 --- a/docs/compose/.env +++ b/docs/compose/.env @@ -132,3 +132,6 @@ REAL_IP_HEADER= # IPs for nginx set_real_ip_from (CIDR list separated by commas) REAL_IP_FROM= + +# choose wether mailu bounces (no) or rejects (yes) mail when recipient is unknown (value: yes, no) +REJECT_UNLISTED_RECIPIENT=