Skip to content

Reading HTML emails

bonds edited this page Sep 16, 2014 · 5 revisions

Sup doesn't speak HTML out of the box. But its easy to add that ability.

  1. Install Lynx, the text web browser.
  2. Create a file called ~/.sup/hooks/mime-decode.rb
  3. Add the following to ~/.sup/hooks/mime-decode.rb
require 'shellwords'
unless sibling_types.member? "text/plain"
  case content_type
  when "text/html"
  `lynx -assume_charset=#{charset} -display_charset=utf-8 -dump #{Shellwords.escape filename}`
  end
end

Voila! Now, instead of seeing an HTML attachment when you an open an HTML email, you'll see the HTML converted to plain text. If you're curious, you can read more about Hooks (of which this an example).

Clone this wiki locally