On Thu, May 19, 2022 at 01:12:31PM -0500, Derek Martin wrote:
On Thu, May 19, 2022 at 11:06:38AM -0700, Kevin J. McCarthy wrote:Sorry, this isn't currently possible in Mutt. The $sendmail variable is handled specially: it's tokenized by space and invoked directly via execvp(). So you won't be able to use arguments with spaces in them inside the variable, or any shell quoting since it doesn't pass through the shell.Couldn't you do something like the following? set my_sendmail=/usr/bin/msmtp [...] --passwordeval=$(gpg --no-tty -q -d ~/.user.gpg)" set sendmail=$my_sendmail Don't know, haven't tried it, but as long as the first thing evaluates to something that sendmail's tokenization can handle, seems like it should work...
$sendmail goes through muttrc evaluation like other variables, but when invoked to send an email, the resulting string is tokenized by space, '--' and various arguments inserted as needed, and then passed to execvp().
Yes, this should be documented and I'll add it to the config option shortly.
I don't know why it was written this way, perhaps some security concerns, but I agree that it's surprising.
-- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature