Skip to content

Commit

Permalink
Merge pull request #58 from DJAndries/master
Browse files Browse the repository at this point in the history
Fixes for custom subdomain names
  • Loading branch information
LukeSmithxyz committed Nov 30, 2020
2 parents 41083d5 + 30fd2d5 commit c749c1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions emailwiz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c749c1d

Please sign in to comment.