diff --git a/SubModules/postfix/CMSHook-preconf.sh b/SubModules/postfix/CMSHook-preconf.sh index a95924d..1292d46 100644 --- a/SubModules/postfix/CMSHook-preconf.sh +++ b/SubModules/postfix/CMSHook-preconf.sh @@ -1,25 +1,26 @@ if [ -z "${sitename}" ]; then sitename=${domain//./_};fi if [ $IMODE = n ]; then - if (whiptail --title "Config" --yesno " Send mail as info@$domain of $domain" 11 78); 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) - sed -e 's/[^@]*@//' <<< "$mail" + maildomain=$(sed -e 's/[^@]*@//' <<< "$mail") fi fi if [ $IMODE = l ]; then while true; do - read -p "Hostname with nxdi.nl -> yes/no?" yn + read -p "Send mail as info@$domain for $domain" yn case $yn in [Yy]* ) mailas=info@$domain maildomain=$domain break;; [Nn]* ) - echo 'Enter full hostname:' - read hostname + echo 'Enter mail addres for sending mail' + read mail + maildomain=$(sed -e 's/[^@]*@//' <<< "$mail") break;; * )echo "Choose yes or no.";; esac diff --git a/SubModules/postfix/conf.sh b/SubModules/postfix/conf.sh index 1959030..db7df5e 100644 --- a/SubModules/postfix/conf.sh +++ b/SubModules/postfix/conf.sh @@ -37,7 +37,7 @@ EOF ##--------------## adduser postfix opendkim -rm -rm /etc/opendkim.d +rm -rf /etc/opendkim.d mkdir -p /etc/opendkim.d/keys chown opendkim:opendkim /etc/opendkim.d/keys -R curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/postfix/config/opendkim.conf -o /etc/opendkim.d.conf @@ -65,7 +65,7 @@ sudo --user opendkim mkdir /etc/opendkim.d/keys/"$hostname" sudo --user opendkim opendkim-genkey -r -D /etc/opendkim.d/keys/"$hostname" -d "$hostname" -s $odksec echo ""$odksec"._domainkey."$hostname" "$hostname":"$odksec":/etc/opendkim.d/keys/"$hostname"/"$odksec".private" >> /etc/opendkim.d/KeyTable curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/postfix/opendkim-init.sh -o ~/OpenDKIMInit-host.sh -sed -i -e 's/DOMAINname/'$hostname'/' -e 's/SITEName/'host'/' 's/vps/'$odksec'/' ~/OpenDKIMInit-host.sh +sed -i -e 's/DOMAINname/'$hostname'/' -e 's/SITEName/'host'/' -e 's/vps/'$odksec'/' ~/OpenDKIMInit-host.sh unset odksec