From 58799452e04577d763e7c616b934eb5947b0e942 Mon Sep 17 00:00:00 2001 From: Simone Frassinelli Date: Fri, 17 Sep 2021 18:54:25 +0200 Subject: [PATCH] Prevented escaped chars Some of strings can escape with chars like ( ! ), causing break in code. Using ' instead of " will prevent exiting from command --- emailwiz.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/emailwiz.sh b/emailwiz.sh index 5fa84fc..1e25f94 100755 --- a/emailwiz.sh +++ b/emailwiz.sh @@ -74,10 +74,10 @@ postconf -e "smtp_tls_security_level = may" postconf -e "smtpd_tls_auth_only = yes" # Exclude obsolete, insecure and obsolete encryption protocols. -postconf -e "smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1" -postconf -e "smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1" -postconf -e "smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1" -postconf -e "smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1" +postconf -e 'smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1' +postconf -e 'smtp_tls_mandatory_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1' +postconf -e 'smtpd_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1' +postconf -e 'smtp_tls_protocols = !SSLv2, !SSLv3, !TLSv1, !TLSv1.1' # Exclude suboptimal ciphers. postconf -e "tls_preempt_cipherlist = yes" @@ -102,7 +102,7 @@ postconf -e "home_mailbox = Mail/Inbox/" # master.cf echo "Configuring Postfix's master.cf..." -sed -i "/^\s*-o/d;/^\s*submission/d;/^\s*smtp/d" /etc/postfix/master.cf +sed -i '/^\s*-o/d;/^\s*submission/d;/^\s*smtp/d' /etc/postfix/master.cf echo "smtp unix - - n - - smtp smtp inet n - y - - smtpd @@ -215,7 +215,7 @@ plugin { # If using an old version of Dovecot, remove the ssl_dl line. case "$(dovecot --version)" in - 1|2.1*|2.2*) sed -i "/^ssl_dh/d" /etc/dovecot/dovecot.conf ;; + 1|2.1*|2.2*) sed -i '/^ssl_dh/d' /etc/dovecot/dovecot.conf ;; esac mkdir /var/lib/dovecot/sieve/ @@ -274,10 +274,10 @@ sed -i '/^#Canonicalization/s/simple/relaxed\/simple/' /etc/opendkim.conf sed -i '/^#Canonicalization/s/^#//' /etc/opendkim.conf sed -i '/Socket/s/^#*/#/' /etc/opendkim.conf -grep -q "^Socket\s*inet:12301@localhost" /etc/opendkim.conf || echo "Socket inet:12301@localhost" >> /etc/opendkim.conf +grep -q '^Socket\s*inet:12301@localhost' /etc/opendkim.conf || echo "Socket inet: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 +sed -i '/^SOCKET/d' /etc/default/opendkim && echo "SOCKET=\"inet:12301@localhost\"" >> /etc/default/opendkim # Here we add to postconf the needed settings for working with OpenDKIM echo "Configuring Postfix with OpenDKIM settings..." @@ -302,7 +302,7 @@ done # If ufw is used, enable the mail ports. pgrep ufw >/dev/null && { ufw allow 993; ufw allow 465 ; ufw allow 587; ufw allow 25 ;} -pval="$(tr -d "\n"