-
Notifications
You must be signed in to change notification settings - Fork 96
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.
- Install Lynx, the text web browser.
- Create a file called ~/.sup/hooks/mime-decode.rb
- 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).