How does neomutt use the sendmail variable?

388 Views Asked by At

By default, neomutt sends plain text emails. In many other mail clients, these render in a monospaced font and therefore look out of place. For this reason I'd like to automatically convert my emails to html, create a multipart/alternative message and attach both versions. I created a small python script to do just this: take an email on stdin, parse it and write it to stdout.

I thought the next step would be to set sendmail = "/home/me/bin/add_html.py | /home/me/bin/msmtpq". This does not send the email however. The script by itself works fine as does the msmtpq command and the full pipeline when launched from bash. Therefore I think the sendmail command is not simply postfixed by the addressee and run as a shell command. Is this correct? If so, how exactly does neomutt use the sendmail variable?

1

There are 1 best solutions below

0
On

As @Juancho suggested in their answer, wrapping the piped command set as a single script will work

You can see a real-time example in this video https://www.youtube.com/watch?v=blqvk-eth3E