Mod:Postfix updated CMSHook and fixed sed (again)

This commit is contained in:
2021-02-05 17:33:26 +01:00
parent c60b57d41b
commit 10838eb815
2 changed files with 8 additions and 7 deletions

View File

@@ -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

View File

@@ -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