Browse Source

approaching prontonmail fix

tags/v3.1
Luke Smith 5 years ago
parent
commit
9e2bde6f3c
No known key found for this signature in database GPG Key ID: 4C50B54A911F6252
1 changed files with 8 additions and 0 deletions
  1. +8
    -0
      bin/mw

+ 8
- 0
bin/mw View File

@@ -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 '<sync-mailbox><enter-command>source $accdir/$idnum-$title.muttrc<enter><change-folder>!<enter>;<check-stats>' \"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 ;}



Loading…
Cancel
Save