Parting from this:

> printf "%b\n" "$msg" | mutt -s "Test message" -e 'set 
> my_user="u...@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"' recei...@domain.tld
> 
> Trying to add "--" did not work at all, no matter where I put it:
> [...] sendmail="[...] --"' recei...@domain.tld
> [...] sendmail="[...]"' -- recei...@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" recei...@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.

Reply via email to