Nearly got all the password stuff working.
This commit is contained in:
parent
f48d108407
commit
b3cd2c77d4
@ -110,19 +110,25 @@ add_email_address()
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
# Password encryption with gpg
|
# Password encryption with gpg
|
||||||
until [ "$passOne" = "passTwo" ]; do
|
passOne=a
|
||||||
read -sp "Please enter the password for $1: " passOne
|
passTwo=b
|
||||||
|
until [ "$passOne" = "$passTwo" ]; do
|
||||||
|
read -sp "Please enter the password for $emailAddress: " passOne
|
||||||
|
echo
|
||||||
read -sp "Please enter the password again: " passTwo
|
read -sp "Please enter the password again: " passTwo
|
||||||
if [ "$passOne" != "passTwo" ]; then
|
echo
|
||||||
|
if [ "$passOne" != "$passTwo" ]; then
|
||||||
echo "The passwords do not match."
|
echo "The passwords do not match."
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
keyName="$(grep 'pgp_sign_as=' "$muttHome/pgp.rc" | cut -d '=' -f2)"
|
keyName="$(grep 'pgp_sign_as=' "$muttHome/gpg.rc" | cut -d '=' -f2)"
|
||||||
|
echo "key name is $keyName"
|
||||||
# I wish it were possible to just echo the password through gpg and not have an unencrypted file at all.
|
# I wish it were possible to just echo the password through gpg and not have an unencrypted file at all.
|
||||||
# but either it's not, or I just can't figure out how to do it. So we'll use mktemp and shred.
|
# but either it's not, or I just can't figure out how to do it. So we'll use mktemp and shred.
|
||||||
passwordFile="$(mktemp)"
|
passwordFile="$(mktemp)"
|
||||||
echo -e "set imap_pass=\"$passOne\"\nset smtp_pass=\"$passOne\"" > "$passwordFile"
|
echo -e "set imap_pass=\"$passOne\"\nset smtp_pass=\"$passOne\"" > "$passwordFile"
|
||||||
gpg -r $keyName -e "$passwordFile" --output "$muttHome/$emailAddress.gpg"
|
gpg -r $keyName -e "$passwordFile"
|
||||||
|
mv "$passwordfile.gpg" "$muttHome/$emailAddress.gpg"
|
||||||
}
|
}
|
||||||
|
|
||||||
configure_gmail()
|
configure_gmail()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user