From 42e612a0e2c6685d4e1dd320ceeac18294f2e95b Mon Sep 17 00:00:00 2001 From: APoniatowski Date: Wed, 26 Apr 2023 18:23:35 +0200 Subject: [PATCH 1/3] Made minor changes to postconf changes, to fix the relay access denied issue. --- emailwiz.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/emailwiz.sh b/emailwiz.sh index d3927fa..4cc3a00 100644 --- a/emailwiz.sh +++ b/emailwiz.sh @@ -53,6 +53,12 @@ esac echo "Configuring Postfix's main.cf..." +# Adding additional vars to fix an issue with receiving emails (relay access denied) and adding it to mydestination. +postconf -e "myhostname = $maildomain" +postconf -e "mail_name = $domain" #This is for the smtpd_banner +postconf -e "mydomain = $domain" +postconf -e "mydestination = $myhostname, $mydomain, mail, localhost.localdomain, localhost, localhost.$mydomain" + # Change the cert/key files to the default locations of the Let's Encrypt cert/key postconf -e "smtpd_tls_key_file=$certdir/privkey.pem" postconf -e "smtpd_tls_cert_file=$certdir/fullchain.pem" @@ -120,7 +126,15 @@ submission inet n - y - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt -o smtpd_sasl_auth_enable=yes - -o smtpd_tls_auth_only=yes + -o smtpd_enforce_tls=yes + -o smtpd_sasl_type=dovecot + -o smtpd_sasl_path=private/auth + -o smtpd_sasl_security_options=noanonymous + -o smtpd_sasl_local_domain=\$myhostname + -o smtpd_client_restrictions=permit_sasl_authenticated,reject + -o smtpd_sender_restrictions=reject_sender_login_mismatch + -o smtpd_sender_login_maps=hash:/etc/postfix/virtual + -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject_unauth_destination smtps inet n - y - - smtpd -o syslog_name=postfix/smtps -o smtpd_tls_wrappermode=yes From eaa3d1800a5c54d152530e16308fa5d1a11630b9 Mon Sep 17 00:00:00 2001 From: APoniatowski Date: Wed, 26 Apr 2023 18:30:38 +0200 Subject: [PATCH 2/3] Missed a parameter, thanks to copy/paste mistake --- emailwiz.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emailwiz.sh b/emailwiz.sh index 4cc3a00..16d7983 100644 --- a/emailwiz.sh +++ b/emailwiz.sh @@ -125,7 +125,7 @@ smtp inet n - y - - smtpd submission inet n - y - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=encrypt - -o smtpd_sasl_auth_enable=yes + -o smtpd_tls_auth_only=yes -o smtpd_enforce_tls=yes -o smtpd_sasl_type=dovecot -o smtpd_sasl_path=private/auth From 11dfca17b2122d114d8f872a4a1cb391299beebc Mon Sep 17 00:00:00 2001 From: APoniatowski Date: Wed, 26 Apr 2023 18:41:38 +0200 Subject: [PATCH 3/3] change made and removed all sasl parameters --- emailwiz.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/emailwiz.sh b/emailwiz.sh index 16d7983..472a549 100644 --- a/emailwiz.sh +++ b/emailwiz.sh @@ -127,10 +127,6 @@ submission inet n - y - - smtpd -o smtpd_tls_security_level=encrypt -o smtpd_tls_auth_only=yes -o smtpd_enforce_tls=yes - -o smtpd_sasl_type=dovecot - -o smtpd_sasl_path=private/auth - -o smtpd_sasl_security_options=noanonymous - -o smtpd_sasl_local_domain=\$myhostname -o smtpd_client_restrictions=permit_sasl_authenticated,reject -o smtpd_sender_restrictions=reject_sender_login_mismatch -o smtpd_sender_login_maps=hash:/etc/postfix/virtual