You are not logged in.

#1 2021-10-29 17:53:04

Registered: 2020-06-03
Posts: 30

s-nail not decrypting -netrc.gpg file?

Hey all,

I am not completely clear with regards to keyring, so it might be a newbie issue:
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-use-starttls # only works if I specify user:pass@ ahead of
   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.

My .netrc:

machine * login NAME password PASS

Thanks for all the inputs.

Last edited by itarill (2021-10-29 21:13:16)


#2 2021-11-24 19:24:20

Registered: 2014-06-13
Posts: 30

Re: s-nail not decrypting -netrc.gpg file?

(Sorry for the late reply, i only look occasionally.. maintainer of S-nail..)
I do use this mechanism myself for my GMail accounts and more, it works just fine?
Notes from a glance:
- localopts is implied for accounts.
- You do not need "wysh" there.
- Is it a miss that there is no "set" before netrc-pipe?

Ah, did you miss to "set v15-compat=y"?  This must be enabled, otherwise the NETRC path is not taken at all!


Board footer

Powered by FluxBB