Home

HTML email, mutt, and Markdown

  • Feb. 18th, 2007 at 10:51 PM
lens

(Yes, this is another technical post. Sorry, [info]embitteredpoet. For those of you uninterested in the rest of this post, take a look at a stuffed squirrel riding a go-cart for sale on eBay.)

Like most geeks, I am not a big fan of HTML email. This is partly because my email client is mutt, which is text-only, and partly because HTML email tends to be full of mad flashing things, images and other badness.

When I write email, I tend to use text formatting similar to that of Markdown. By design, Markdown source is human-readable, so it's a pretty sensible set of conventions to use for emphasis, links etc. in plain text. This works pretty well for people with similar tastes in email clients, but is suboptimal for people who use things capable of rendering rich text. Ideally, those people would see the text as rendered by running it through the markdown command — that is, as HTML. One way to accomplish this would be to write plugins for every graphical email client under the sun; the other, more practical way is to render it before I send the email and send HTML email.

I'm instinctively offended by the suggestion, but neither of my reasons for hating HTML email apply here: I'd still send the Markdown source as the plain text version, and the messages wouldn't be any more full of crap than they are in plain text. I think I should duct tape this functionality onto the side of mutt. My Googlings have not found anyone else who's done this before, but I figure I should check: dear Lazyweb, have you seen scripts to do this that I could use rather than writing my own? I'd probably write a script that acts as /usr/sbin/sendmail as far as mutt is concerned, but which checks the plain-text bit for Markdown syntax and generates the text/html part if necessary.

(Also, I should make pyljpost.vim understand Markdown, but that involves learning Python.)