0

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?

Octaviour
  • 745
  • 6
  • 18
  • 2
    neomutt uses a fork() and execvp() to call sendmail ([check the code here](https://github.com/neomutt/neomutt/blob/master/sendlib.c#L2675)), so I doubt a shell script is valid here. You may need to wrap all this into one script. – Juancho Jan 09 '20 at 19:18

1 Answers1

1

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

jenks
  • 383
  • 1
  • 3
  • 11