summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2023-04-26 16:44:56 +0000
committerGitHub <noreply@github.com>2023-04-26 16:44:56 +0000
commit5c7426b1c34334bec0c001a83494128944434474 (patch)
tree6405eb5a1efdbb8a3e63ea9db8d9a2fb3c9e9e7b
parent3f2b10f85438f1879cf825149fbec7120248734d (diff)
parent11dfca17b2122d114d8f872a4a1cb391299beebc (diff)
Merge pull request #275 from APoniatowski/master
Relay access denied fix
-rw-r--r--emailwiz.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/emailwiz.sh b/emailwiz.sh
index d3927fa..472a549 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"
@@ -119,8 +125,12 @@ 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_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