Inline view of HTML emails

5 views
Skip to first unread message

Robert Winkler

unread,
Nov 19, 2020, 11:14:45 AM11/19/20
to The Sup email client
Hi,
many people send their mails in HTML format only.  Currently, I open them in an external browser.  But seeing them inline would be nice.
 Is there a way how to do this?
Best regards,
Robert 

Iain Parris

unread,
Nov 26, 2020, 5:31:09 PM11/26/20
to Robert Winkler, The Sup email client
Hi Robert,

Excerpts from Robert Winkler's message of 2020-11-19 08:14:45 -0800:
> many people send their mails in HTML format only. Currently, I open them
> in an external browser. But seeing them inline would be nice.
> Is there a way how to do this?

A mime-decode hook could accomplish this.

See:
<https://github.com/sup-heliotrope/sup/wiki/Viewing-Attachments#decoding-attachments>.

You would need w3m installed, and to create the file
~/.sup/hooks/mime-decode.rb containing contents as above.

Another alternative (but which wouldn't display the HTML inline) is to
create a mailcap file ~/.mailcap containing:

text/html; /usr/bin/w3m -T text/html %s; needsterminal; description=HTML Text; nametemplate=%s.html

With this alternative, pressing enter on a .html file would display it
in w3m, instead of launching a desktop GUI browser.

Kind regards,
Iain

Robert Winkler

unread,
Nov 26, 2020, 7:46:08 PM11/26/20
to The Sup email client
Hi Iain,

Thanks again! I added the following code

require 'shellwords' 
unless sibling_types.member? "text/plain" 
    case content_type 
    when "text/html" 
        `/usr/bin/w3m -dump -T #{content_type} #{Shellwords.escape filename}` 
    end 
end

in a new hook ~/.sup/hooks/mime-decode.rb

Let's see how it works.

Best regards, 
Robert
Reply all
Reply to author
Forward
0 new messages