summaryrefslogtreecommitdiff
path: root/emailwiz.sh
diff options
context:
space:
mode:
authorAPoniatowski <adaml.poniatowski@gmail.com>2023-04-26 18:23:35 +0200
committerAPoniatowski <adaml.poniatowski@gmail.com>2023-04-26 18:23:35 +0200
commit42e612a0e2c6685d4e1dd320ceeac18294f2e95b (patch)
tree4374287b3bafc607340358a94d32aed5027f03b7 /emailwiz.sh
parent3f2b10f85438f1879cf825149fbec7120248734d (diff)
Made minor changes to postconf changes, to fix the relay access denied issue.
Diffstat (limited to 'emailwiz.sh')
-rw-r--r--emailwiz.sh16
1 files changed, 15 insertions, 1 deletions
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