diff options
author | Luke Smith <luke@lukesmith.xyz> | 2020-11-30 18:56:49 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-30 18:56:49 -0500 |
commit | c749c1dd601104beaf6cd406e770f0b669a51366 (patch) | |
tree | c18bd20625aa01ef5c65b8a32bcf932b41d28e0f | |
parent | 41083d5ca4187b3d941aff6f7d6019810a6f85bb (diff) | |
parent | 30fd2d5d8d71825fb1bbbe4fc9ca01aebcd0f093 (diff) |
Merge pull request #58 from DJAndries/master
Fixes for custom subdomain names
-rwxr-xr-x | emailwiz.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/emailwiz.sh b/emailwiz.sh index 444f6c3..22b6b84 100755 --- a/emailwiz.sh +++ b/emailwiz.sh @@ -38,7 +38,7 @@ apt install postfix dovecot-imapd dovecot-sieve opendkim spamassassin spamc # Check if OpenDKIM is installed and install it if not. which opendkim-genkey >/dev/null 2>&1 || apt install opendkim-tools domain="$(cat /etc/mailname)" -subdom="mail" +subdom=${MAIL_SUBDOM:-mail} maildomain="$subdom.$domain" certdir="/etc/letsencrypt/live/$maildomain" @@ -247,7 +247,7 @@ chmod g+r /etc/postfix/dkim/* # Generate the OpenDKIM info: echo "Configuring OpenDKIM..." grep -q "$domain" /etc/postfix/dkim/keytable 2>/dev/null || -echo "$subdom._domainkey.$domain $domain:mail:/etc/postfix/dkim/mail.private" >> /etc/postfix/dkim/keytable +echo "$subdom._domainkey.$domain $domain:$subdom:/etc/postfix/dkim/$subdom.private" >> /etc/postfix/dkim/keytable grep -q "$domain" /etc/postfix/dkim/signingtable 2>/dev/null || echo "*@$domain $subdom._domainkey.$domain" >> /etc/postfix/dkim/signingtable |