|
|
@@ -1,6 +1,11 @@ |
|
|
|
#!/bin/sh |
|
|
|
[ ! -f "$HOME/.password-store/.gpg-id" ] && printf "\`pass\` must be installed and initialized to encrypt passwords.\\nBe sure it is installed and run \`pass init <yourgpgemail>\`.\\nIf you don't have a GPG public private key pair, run \`gpg --full-gen-key\` first.\\n" && exit |
|
|
|
[ ! -f "$HOME/.password-store/.gpg-id" ] && printf "\`pass\` or \`gopass\` must be installed and initialized to encrypt passwords.\\nBe sure it is installed and run \`(go)pass init <yourgpgemail>\`.\\nIf you don't have a GPG public private key pair, run \`gpg --full-gen-key\` first.\\n" && exit |
|
|
|
! command -v mbsync >/dev/null && printf "\`mbsync\` must be installed to run mutt-wizard.\\n" && exit |
|
|
|
pass="pass" |
|
|
|
ifinstalled gopass |
|
|
|
if [ $? -eq 0 ]; then |
|
|
|
pass="gopass" |
|
|
|
fi |
|
|
|
muttdir="$HOME/.config/mutt" # Main mutt config location |
|
|
|
accdir="$muttdir/accounts" # Directory for account settings |
|
|
|
maildir="$HOME/.local/share/mail" # Location of mail storage |
|
|
@@ -35,13 +40,12 @@ host $smtp |
|
|
|
port $sport |
|
|
|
from $fulladdr |
|
|
|
user $login |
|
|
|
passwordeval \"pass mutt-wizard-$title\" |
|
|
|
" |
|
|
|
passwordeval \"$pass mutt-wizard-$title\"" |
|
|
|
mbsync_profile="IMAPStore $title-remote |
|
|
|
Host $imap |
|
|
|
Port $iport |
|
|
|
User $login |
|
|
|
PassCmd \"pass mutt-wizard-$title\" |
|
|
|
PassCmd \"$pass mutt-wizard-$title\" |
|
|
|
SSLType $ssltype |
|
|
|
CertificateFile $sslcert |
|
|
|
|
|
|
@@ -93,7 +97,7 @@ set folder = \"imaps://$fulladdr@$imap:$iport\" |
|
|
|
set imap_user = \"$login\" |
|
|
|
set header_cache = $cachedir/$title/headers |
|
|
|
set message_cachedir = $cachedir/$title/bodies |
|
|
|
set imap_pass = \`pass mutt-wizard-$title\` |
|
|
|
set imap_pass = \`$pass mutt-wizard-$title\` |
|
|
|
|
|
|
|
set mbox_type = Maildir |
|
|
|
set ssl_starttls = yes |
|
|
@@ -174,8 +178,8 @@ 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" |
|
|
|
} |
|
|
|
|
|
|
|
getpass() { while : ; do pass rm -f "mutt-wizard-$title" >/dev/null 2>&1 |
|
|
|
pass insert "mutt-wizard-$title" && break; done ;} |
|
|
|
getpass() { while : ; do $pass rm -f "mutt-wizard-$title" >/dev/null 2>&1 |
|
|
|
$pass insert "mutt-wizard-$title" && break; done ;} |
|
|
|
|
|
|
|
formatShortcut() { \ |
|
|
|
while read -r data; do { echo "macro index,pager g$1 \"<change-folder>$data<enter>\" \"go to $2\" # mw-autogenerated" |
|
|
|