From 616f0a216225bbcb22aae19403111dff2f6c4c1d Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Fri, 5 Feb 2021 18:05:23 +0100 Subject: [PATCH] Mod:Postfix Fixed ODK Sock for deb & Clean CMSHOOK --- SubModules/postfix/CMSHook-conf.sh | 2 +- SubModules/postfix/CMSHook-preconf.sh | 24 ++++++++++++------------ SubModules/postfix/conf.sh | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/SubModules/postfix/CMSHook-conf.sh b/SubModules/postfix/CMSHook-conf.sh index 38e4efc..2fa4488 100644 --- a/SubModules/postfix/CMSHook-conf.sh +++ b/SubModules/postfix/CMSHook-conf.sh @@ -10,7 +10,7 @@ fi curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/postfix/opendkim-init.sh -o ~/OpenDKIMInit-$sitename.sh -sed -i -e 's/DOMAINname/'$domain'/' 's/SITEName/'$sitename'/' ~/OpenDKIMInit-$sitename.sh +sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEName/'$sitename'/' ~/OpenDKIMInit-$sitename.sh cat << EOF > /etc/update-motd.d/51-opendkim-"$sitename" #!/bin/sh diff --git a/SubModules/postfix/CMSHook-preconf.sh b/SubModules/postfix/CMSHook-preconf.sh index 1292d46..7d0bb76 100644 --- a/SubModules/postfix/CMSHook-preconf.sh +++ b/SubModules/postfix/CMSHook-preconf.sh @@ -1,28 +1,28 @@ if [ -z "${sitename}" ]; then sitename=${domain//./_};fi if [ $IMODE = n ]; then - if (whiptail --title "Config" --yesno " Send mail as info@$domain for $domain" 11 78); then - mailas=info@$domain - maildomain=$domain -else - mailas=$(whiptail --nocancel --inputbox " Enter mail addres for sending mail" 11 78 --title "Config" 3>&1 1>&2 2>&3) - maildomain=$(sed -e 's/[^@]*@//' <<< "$mail") + if (whiptail --title "Config" --yesno " Send mail as info@$domain for $domain?" 11 78); then + mailas=info@$domain + maildomain=$domain + else + mailas=$(whiptail --nocancel --inputbox " Enter mail addres for sending mail?" 11 78 --title "Config" 3>&1 1>&2 2>&3) + maildomain=$(sed -e 's/[^@]*@//' <<< "$mail") + fi fi -fi if [ $IMODE = l ]; then while true; do - read -p "Send mail as info@$domain for $domain" yn + read -p "Send mail as info@$domain for $domain? (y/n)" yn case $yn in [Yy]* ) mailas=info@$domain maildomain=$domain break;; [Nn]* ) - echo 'Enter mail addres for sending mail' - read mail - maildomain=$(sed -e 's/[^@]*@//' <<< "$mail") + echo 'Enter mail addres for sending mail? ' + read mail + maildomain=$(sed -e 's/[^@]*@//' <<< "$mail") break;; * )echo "Choose yes or no.";; esac done -fi +fi \ No newline at end of file diff --git a/SubModules/postfix/conf.sh b/SubModules/postfix/conf.sh index db7df5e..27e04d5 100644 --- a/SubModules/postfix/conf.sh +++ b/SubModules/postfix/conf.sh @@ -52,8 +52,8 @@ EOF if [ "$shortdist" = "ubu1804" ] || [ "$shortdist" = "ubu2004" ] || [ "$shortdist" = "deb10" ] ; then - mkdir /var/spool/postfix/opendkim - sudo chown opendkim:postfix /var/spool/postfix/opendkim + mkdir -p /var/spool/postfix/var/run/opendkim + sudo chown opendkim:postfix /var/spool/postfix/var/run/opendkim sed -i "/^RUNDIR=/c\RUNDIR=/var/spool/postfix/var/run/opendkim" /etc/default/opendkim echo "TrustAnchorFile /usr/share/dns/root.key" >> /etc/opendkim.d/conf bash /lib/opendkim/opendkim.service.generate