You are not logged in.
Hi,
(password example: Don'tTell)
So far, the only hack I have found uses an expect script, which seems a bit awkward.
Is there a way to escape the single quote in the password when it's provided in .msmtprc? (Bash escape fails.)
Alternatively, is there a way to pipe the password to the command from stdin, e.g., with printf "Don'tTell\n"
(The Gnome Keyring is not an option and .netrc is no longer functional.)
Last edited by herOldMan (2022-01-16 21:59:32)
Offline
I strongly recommend that you use passwordeval. This will a) avoid the plaintext storage issue, and b) provide greater flexibility in terms of special characters that would ordinarily require shell escaping contortions.
Do you use a password manager?
Last edited by jasonwryan (2022-01-16 21:04:29)
Offline
Hi,
No password manager on this system. No DE or DM either.
Offline
Just write the password without any escaping?
Or write it in another file and use passwordeval to read it, you could also encrypt/decrypt it that way (not too secure but maybe better than nothing).
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
Using the password with the single quote in the .msmtprc file results in a bad password error at the smtp server.
My eyes are failing me and I am unable to find an example showing how to use a plaintext file in conjunction with the passwordeval option (anywhere).
Here's what I tried:
I put the password in a file named pw
In my .msmtprc, I added the line:
passwordeval "~/pw"
here's what I get:
...
sh: -c: line 1: unexpected EOF while looking for matching `''
sh: -c: line 2: syntax error: unexpected end of file
msmtp: cannot read output of 'Don'tTell'
Offline
Hi,
Stupid me:
passwordeval "cat ~/pw"
Offline
passwordeval takes a command to execute, not a file to read. See the man page.
Typically people invoke their password manager in there, e.g.
passwordeval "pass show mail/ayekat@mailserver.tld | head -n1"
But if you just want to read a plaintext file, you could just have that be "head -n1 ~/pw".
--edit: Ah, you noticed it. :-)
Last edited by ayekat (2022-01-16 22:01:04)
Offline
Thanks ayekat
Offline