GPG Decrypt Error based on a timeout function?

donnellydw at gmail.com donnellydw at gmail.com
Thu Dec 17 20:28:57 CET 2020


Good Day,

  This very novice would appreciate some help.

 

  My situation:

 

I have a Raspberry Pi 4 computer running the Raspberry Operating System
(Raspbian GNU/Linux [buster], Version ID=10) at my home.  I need it to send
me an email notification when certain functions are performed.

 

To this end, I have configured the mail system called msmtp on the Raspberry
Pi 4 computer.  I can send email to my myself via my email account manually
and interactively using msmtp on the Raspberry Pi 4 computer, with the
password not encrypted on the Raspberry Pi 4 computer.

 

I have gpg version 2.2.12-1+rpi1+deb10u1 installed on this Raspberry Pi 4
Computer.

 

 

Problem:

Following good security policies, I encrypted my email account password
using gpg.  My encrypted password is stored in a file
(/home/pi/.msmtp-2d-ionos.gpg) on the Raspberry Pi4 computer.

 

I successfully created my gpg key.  I was able to successfully run the
following command: 

 

gpg --encrypt -o .msmtp-2d.ionos.gpg -r 2d at daviddonnelly.com -

 

 

The password provided was encrypted with no problems and the associated file
was created.

 

 

However, when I run the following command, it initially works.  Meaning the
associated password is decrypted and the e-mail is sent:

 

msmtp -t < message.txt

 

But after a few minutes, when I retest the command:

 

msmtp -t < message.txt

 

I get the following error:

 

gpg: decryption failed: No secret key

 

When I run the following command:

 

gpg --encrypt -o .msmtp-2d.ionos.gpg -r 2d at daviddonnelly.com -

 

I am asked for my passphrase, once entered the file is decrypted and the
contents displayed.  I then rerun the command:

 

msmtp -t < message.txt

 

and the associated e-mail is sent.

 

I wait a few minutes and the error repeats itself.

 

Is there some sort of timeout associated with gpg? Or my implementation is
wrong.or ?

 

Also, I have noticed, at times, gpg will not accept the passphrase until I
reboot the Raspberry pi 4.

 

 

Your help in this matter is greatly appreciated,

Dave

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20201217/fde89bdc/attachment-0001.html>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Untitled attachment 00042.txt
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20201217/fde89bdc/attachment-0001.txt>


More information about the Gnupg-users mailing list