Score:0

s-nail not decrypting netrc.gpg file?

vn flag

I set up msmtp and s-nail to work with my gmail account. It works if the password is stored in plain text in .netrc, but does not work with .netrc.gpg:

echo 'Message body' | mailx -A mymail --subject='A subject' email@address 'name <email@address>'

Here is the error message:

email@address requires a password: 
mail: A password is necessary for smtp authentication
/home/myuser/mail/dead.mbox 3/49
mail: ... message not sent

My .mailrc config:

account mymail {
   # Localize options, forget them when changing the account
   localopts yes
  
   ####
   # this part does not work with netrc.gpg, only plain netrc:
   wysh set netrc-lookup # even if I comment this line
   netrc-pipe='gpg -qd ~/.netrc.gpg'
   ####

   set mta=smtp://smtp.gmail.com:587 smtp-use-starttls # only works if I specify user:pass@ ahead of smtp.gmail
   set from="name <email@address>"
}

I encrypted my .netrc file for email@address with:

gpg -e /home/myuser/.netrc

and running this in terminal

gpg -qd ~/.netrc.gpg

works, however, this asks for the secret.

This is my netrc file:

machine *.gmail.com login NAME password PASS
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.