From dfa4672c9ce36cd7200c4c56b9aab16b05a7845d Mon Sep 17 00:00:00 2001 From: wimstockman Date: Thu, 13 Feb 2020 17:23:24 +0100 Subject: [PATCH] Added support for STARTTLS The script failed for my VPS , had to change SSLtype for mbsync to STARTTLS instead of IMAPS. Added a question so the user can choose. My error before this adjustement was this: error:1408F10B:SSL routines:ssl3_get_record:wrong version number --- bin/mw | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/mw b/bin/mw index 616b528..4d77d2d 100755 --- a/bin/mw +++ b/bin/mw @@ -21,7 +21,8 @@ mwconfig="$muttshare/mutt-wizard.muttrc" cachedir="$HOME/.cache/mutt-wizard" muttrc="$muttdir/muttrc" msmtprc="$HOME/.config/msmtp/config" -ssltype="IMAPS" # This is later changed to `None` later in the script if using Protonmail +ssltype="IMAPS" + # This is later changed to `None` later in the script if using Protonmail for x in "/etc/ssl/certs/ca-certificates.crt" "/etc/pki/tls/certs/ca-bundle.crt" "/etc/ssl/ca-bundle.pem" "/etc/pki/tls/cacert.pem" "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem" "/etc/ssl/cert.pem" "/usr/local/share/ca-certificates/" do @@ -54,7 +55,6 @@ Port $iport User $login PassCmd \"pass mutt-wizard-$title\" SSLType $ssltype -AuthMech LOGIN CertificateFile $sslcert MaildirStore $title-local @@ -171,6 +171,11 @@ EOF esac [ "$sport" = 465 ] && starttlsoff="tls_starttls off" fi + printf "\nDoes your server uses \033[35mSTARTTLS? \033[0m [Yes/No/Unknown]" + read -r is_TLS + case $is_TLS in + [Yy][Ee][Ss]) ssltype="STARTTLS";; + esac printf "Enter the \033[35mfull name\033[0m you want to be identified by on this account.\\n\tReal name: " read -r realname printf "Enter a short, \033[36mone-word identifier\033[0m for this email account that will distinguish them from any other accounts you add.\\n\tAccount name: "