[neomutt-users] Dynamically controlling sendmail command

Adrian Petrescu adrian at apetre.sc
Fri Feb 14 17:09:38 CET 2020


I prefer sending/receiving emails in plain-text, but due to necessity I
use a variant of the MIMEmbellish script [1] (which basically just
passes it through Pandoc and generates a multipart email with HTML). So
my sendmail variable in neomutt looks like this:

     set sendmail = "$HOME/.config/mutt/scripts/sendmail"

And that sendmail script just does:

     ~/.config/mutt/scripts/MIMEmbellish | msmtp "$@"

(I would rather not do this, but considering how Gmail doesn't respect
`format=flowed` I really sometimes must.)

However, there are certain situations where sending a multipart is _not_
necessary (like messages to mailing lists such as this one, or to
certain @gnu.org email addresses where I worry the message won't even be
read if there's HTML involved 😉). Therefore I would like to have some
sort of manual way to toggle, prior to composing or sending a message,
the sendmail command, _or_ alternatively to pass some sort of variable
to my sendmail script that would allow it to decide whether to invoke
MIMEmbellish itself based on my manual toggle and/or the recipient(s).

However, I cannot figure out how to do this within the limited
expressiveness of muttrc. I can't even seem to be able to `set` a custom
variable that I could manually toggle with a macro and just pass as an
arg to my sendmail script. I suppose some sort of macro using really
complicated format string operations to toggle sendmail itself back and
forth might work, but that seems terrifying.

(BONUS points if I could also somehow display the current state of this
toggle in the send confirmation screen, so I could just double-check
whether I'm in the right mode before committing)

Am I missing some straightforward way to achieve what I'm looking for?
Anyone else perhaps have a totally alternative way to accomplish the
same goal?

Thanks!


[1]: https://nosubstance.me/post/mutt-secret-sauce/#mimembellish-the-email-embellisher


-- 
Adrian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.neomutt.org/pipermail/neomutt-users-neomutt.org/attachments/20200214/2bb752d4/attachment.html>


More information about the neomutt-users mailing list