From 9e2bde6f3cdba482018a53a5577ca82c61ac2163 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 1 May 2019 20:59:58 -0400 Subject: [PATCH] approaching prontonmail fix --- bin/mw | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/bin/mw b/bin/mw index 5691347..f0fcf3c 100755 --- a/bin/mw +++ b/bin/mw @@ -165,6 +165,9 @@ EOF for x in $(seq 1 9); do echo "$accounts" | grep "$x" >/dev/null 2>&1 || { export idnum="$x"; break ;}; done [ ! -f "$HOME/.config/msmtp/config" ] && echo "$msmtp_header" > "$HOME/.config/msmtp/config" echo "$msmtp_profile" >> "$HOME/.config/msmtp/config" + case "$service" in + protonmail.*) protonfinger || return 1 ;; + esac echo "$mutt_profile" > "$accdir/$idnum-$title.muttrc" echo "$mbsync_profile" >> "$mbsyncrc" notmuchauto @@ -174,6 +177,11 @@ EOF echo "macro index,pager i$idnum 'source $accdir/$idnum-$title.muttrc!;' \"switch to $fulladdr\" # mw-autogenerated" >> "$muttrc" } +protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" + fingerprint="$(msmtp --serverinfo --tls --tls-certcheck=off -a "$title")" || return 1 + sed -ibu "s/account $title/&\ntls_fingerprint $fingerprint/" "$HOME/.config/msmtp/config" +} + getpass() { while : ; do pass rm -f "mutt-wizard-$title" >/dev/null 2>&1 pass insert "mutt-wizard-$title" && break; done ;}