New to Mutt, unable to send messages in *any* attempted way
X Tec
xtec at trimaso.com.mx
Wed May 18 22:53:20 UTC 2022
Parting from this:
> printf "%b\n" "$msg" | mutt -s "Test message" -e 'set my_user="user at domain.tld"; set my_url="smtp.domain.tld"; set record=""; set from="Send User<$my_user>"; set envelope_from=yes; set sendmail="/path/to/msmtp --port=587 --tls=on --host=$my_url --auth=on --user=$my_user"' receiver at domain.tld
>
> Trying to add "--" did not work at all, no matter where I put it:
> [...] sendmail="[...] --"' receiver at domain.tld
> [...] sendmail="[...]"' -- receiver at domain.tld
>
By searching in the old Msmtp mailing lists, it seems that Msmtp is intended primarily to send email from standard input (console); when called by an external program, such as Mutt in this case, direct access to tty is normally lost and thus no prompt possible.
So this seems actually expected behavior.
> > - Why you say '"--password" is not a valid command line option'.
> >
> Yes, according to manual "password" is a valid command for .msmtprc; but there's no "--password" option for command line. I tried this last one and got something like "invalid or unknown command".
>
This seems to be by design as well.
However, I still haven't been able to solve this:
> The passwordeval with gpg method also works, albeit I wasn't able to figure out how to use it directly in command line... Trying to use
>
> set sendmail="/usr/bin/msmtp [...] --passwordeval="gpg --no-tty -q -d ~/.user.gpg""
>
> got this:
>
> Error in command line: --no-tty: unknown variable
> gpg: WARNING: no command supplied. Trying to guess what you mean ...
> gpg: processing message failed: Unknown system error
> msmtp: cannot read output of 'gpg'
> Error sending message, child exited 78 ().
> Could not send the message.
>
> I did figure it's an issue with wrongly used quotes (and the gpg command needs them), but still haven't been able to solve it...
>
I tried asking in a Bash forum, but they said this is Mutt explicit question rather than shell quoting stuff.
Indeed, actually trying it in .muttrc and using 'printf "%s\n" "some text" | mutt -s "Some subject" receiver at domain.tld' in command line for sending email yielded the very same error.
I tried everything I could imagine: single/double quotes mixing, escaping space chars with '\', etc. None of them worked.
Could someone help with this last issue by chance, please?
Thanks again beforehand.
More information about the Mutt-users
mailing list