summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Duxler <aaron.duxler@gmail.com>2019-12-25 20:14:14 +0100
committerAaron Duxler <aaron.duxler@gmail.com>2019-12-25 20:14:14 +0100
commit1b455cfee521cc12becbfcb1e399a84da6504b83 (patch)
tree519fbacf235f49ba2904a36764da0eb22930f437
parentdde31ef1063bbf9e372c6aa25526a2dd6ce18be5 (diff)
opendkim socket fix + install opendkim-tools
-rwxr-xr-xemailwiz.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/emailwiz.sh b/emailwiz.sh
index 28560f4..8d66b5f 100755
--- a/emailwiz.sh
+++ b/emailwiz.sh
@@ -18,7 +18,7 @@
echo "Installing programs..."
apt install postfix dovecot-imapd dovecot-sieve opendkim spamassassin spamc
# Install another requirement for opendikm only if the above command didn't get it already
-[ -e $(which opendkim-genkey) ] || apt install opendkim-tools
+[ which opendkim-genkey > /dev/null 2>&1 ] || apt install opendkim-tools
domain="$(cat /etc/mailname)"
subdom="mail"
maildomain="$subdom.$domain"
@@ -215,6 +215,9 @@ InternalHosts refile:/etc/postfix/dkim/trustedhosts" >> /etc/opendkim.conf
sed -i '/^#Canonicalization/s/simple/relaxed\/simple/' /etc/opendkim.conf
sed -i '/^#Canonicalization/s/^#//' /etc/opendkim.conf
+sed -e '/Socket/s/^#*/#/' -i /etc/opendkim.conf
+sed -i '/\local:\/var\/run\/opendkim\/opendkim.sock/a \Socket\t\t\tinet:12301@localhost' /etc/opendkim.conf
+
# OpenDKIM daemon settings, removing previously activated socket.
sed -i "/^SOCKET/d" /etc/default/opendkim && echo "SOCKET=\"inet:12301@localhost\"" >> /etc/default/opendkim