From a4dc0e041e69269442a32c9210b2f247a55bdd87 Mon Sep 17 00:00:00 2001 From: Luke Date: Tue, 13 Feb 2018 13:00:48 -0700 Subject: [PATCH] switch to gpg2 as default --- README.md | 9 ++------- credentials/getmuttpass | 2 +- credentials/imappwd.py | 2 +- mutt-wizard.sh | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9869758..5b934fb 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,7 @@ Mutt is one of the most rewarding programs one can use, but can be a pain in the ## User interface -* The main scripts `mutt-wizard.sh` has options to add new email accounts, or remove unwanted ones. For email providers listed in the `autoconf/domains.csv` file, this will be 100% automatic and for other email addresses it will simply prompt you for you email's SMTP and IMAP server settings (which you can easily look up). -* The scripts will take that information and autogenerate mutt and offlineimap config files so you don't have to worry about them. -* It also creates a email-specific settings for your muttrc, which are outputed in the `accounts/` directory in your mutt directory. - * The script will automatically handle multiple accounts. Each will be assigned a number 1-9, and you can jump from one to another in mutt by pressing `i` and then that number. You can change the numbers by manually editing the macros in `personal.muttrc`. - * For most accounts, you can jump to sent mail with `gs`, drafts with `gd` and the inbox with `gi`. I haven't worked this out for every domain. -* It uses your gpg encryption to store your encrypted password in `credentials/`, where there are also two scripts that allow mutt and offlineIMAP to decrypt the passwords when needed. +The main script can take an email and autodetect its server settings, generating a muttrc and offlineimaprc profile automatically. I gives you options for add accounts to the system, detecting them, removing them and autodetecting mailboxes and generating shortcut keys in mutt. ### Will it work on my email? (95% yes) @@ -23,7 +18,7 @@ The email accounts that *won't* work with the script would include Proton Mail a ## Installation and Dependencies -dialog, neomutt and offlineimap should be installed. The contents of this repo should go directly in `~/.config/mutt/` and run from there. You also need to have a GPG public/private key pair for the wizard to automatically store your passwords. Otherwise you'll have to store them insecurely in plaintext files without the help of the wizard. As a note, if you uuse a distribution like Void that uses GPG2 and not GPG, you should symlink /usr/bin/gpg to /usr/bin/gpg2 or wherever the GPG2 binary lives. +dialog, neomutt and offlineimap should be installed. The contents of this repo should go directly in `~/.config/mutt/` and run from there. You also need to have a GPG public/private key pair for the wizard to automatically store your passwords. Otherwise you'll have to store them insecurely in plaintext files without the help of the wizard. Just run `mutt-wizard.sh` for all the options. diff --git a/credentials/getmuttpass b/credentials/getmuttpass index c5ee8c2..e01c5de 100755 --- a/credentials/getmuttpass +++ b/credentials/getmuttpass @@ -1,4 +1,4 @@ #!/bin/bash -pass=$(gpg -d -q ~/.config/mutt/credentials/$1.gpg) +pass=$(gpg2 -d -q ~/.config/mutt/credentials/$1.gpg) echo set smtp_pass=\"$pass\" echo set imap_pass=\"$pass\" diff --git a/credentials/imappwd.py b/credentials/imappwd.py index 8570a5f..0a74804 100755 --- a/credentials/imappwd.py +++ b/credentials/imappwd.py @@ -4,7 +4,7 @@ home = os.path.expanduser("~") def mailpasswd(acct): acct = os.path.basename(acct) path = "%s/.config/mutt/credentials/%s.gpg" % (home,acct) - args = ["gpg", "--use-agent", "--quiet", "--batch", "-d", path] + args = ["gpg2", "--use-agent", "--quiet", "--batch", "-d", path] try: return subprocess.check_output(args).strip() except subprocess.CalledProcessError: diff --git a/mutt-wizard.sh b/mutt-wizard.sh index 6be5c0c..17104b6 100755 --- a/mutt-wizard.sh +++ b/mutt-wizard.sh @@ -132,7 +132,7 @@ addAccount \ addAccount() { # First, adding the encrypted password. dialog --title "Luke's mutt/offlineIMAP password wizard" --passwordbox "Enter the password for the \"$title\" account." 10 60 2> /tmp/$title - gpg -r $gpgemail --encrypt /tmp/$title || (dialog --title "GPG decryption failed." --msgbox "GPG decryption failed. This is either because you do not have a GPG key pair or because your distro uses GPG2 and you thus need to symlink /usr/bin/gpg to /usr/bin/gpg2." 7 60 && break) + gpg2 -r $gpgemail --encrypt /tmp/$title || (dialog --title "GPG decryption failed." --msgbox "GPG decryption failed. This is either because you do not have a GPG key pair or because your distro uses GPG1 and you thus need to symlink /usr/bin/gpg2 to /usr/bin/gpg." 7 60 && break) shred -u /tmp/$title mv /tmp/$title.gpg ~/.config/mutt/credentials/