summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2017-04-18 07:54:54 (GMT)
committer Jaromil <jaromil@dyne.org>2017-04-18 07:54:54 (GMT)
commitd012394e9cf139c99029341f7b2894458708e354 (patch)
treedbef562e08c98550aa3fcb112bcdcaf29459c2c4
parentfb4254b2ca8a6c443f2a7ebe136f15405025ea08 (diff)
fix default gpg key detection for mutt when using pass
-rwxr-xr-xsrc/zlibs/mutt18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/zlibs/mutt b/src/zlibs/mutt
index eb42c6c..1ca3077 100755
--- a/src/zlibs/mutt
+++ b/src/zlibs/mutt
@@ -58,14 +58,12 @@ x_mutt() {
rm -f "$MAILDIRS/.mutt"/rc
- gpgkey=""
- [[ -f ${PASSWORD_STORE_DIR}/.gpg-id ]] || {
- # detect the default gpg key to always encrypt also to self
- # update: do not re-encrypt if already done
- [[ -r $HOME/.gnupg/gpg.conf ]] && {
- gpgkey=`awk '/^default-key/ { print $2 }' $HOME/.gnupg/gpg.conf`
- act "default GPG key configured: $gpgkey"
- }
+ # detect the default gpg key to always encrypt also to self
+ # update: do not re-encrypt if already done
+ gpgkey=""
+ [[ -r $HOME/.gnupg/gpg.conf ]] && {
+ gpgkey=`awk '/^default-key/ { print $2 }' $HOME/.gnupg/gpg.conf`
+ act "default GPG key configured: $gpgkey"
}
cat<<EOF > "$MAILDIRS/.mutt"/rc
@@ -147,12 +145,14 @@ set pgp_list_pubring_command="${cryptowrap} --batch --quiet --with-colons \
EOF
;;
gpgewrap)
- cat <<EOF > "$MAILDIRS/.mutt/crypto"
+ [[ "$gpgkey" = "" ]] || {
+ cat <<EOF > "$MAILDIRS/.mutt/crypto"
# Generated by JaroMail at every execution
# create a pgp/mime encrypted attachment
set pgp_encrypt_only_command="gpgewrap gpg --batch --quiet --no-verbose --output - --encrypt --textmode --armor --always-trust --encrypt-to $gpgkey -- -r %r -- '%f'"
set pgp_encrypt_sign_command="gpgewrap gpg %?p?--passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - --encrypt --sign %?a?-u %a? --armor --always-trust --encrypt-to $gpgkey -- -r %r -- '%f'"
EOF
+ }
;;
esac