Subject: Re: [sup-devel] How to deal with HTML attachments?

From: Patrick Totzke <[email-masked]>
Date: Wed, 11 May 2011 15:15:17 +0100

Hi,
I use a mime-hook like this for inline html:
in ~/.sup/hooks$ cat mime-decode.rb :

 case content_type
 when "text/html"
   `/usr/bin/lynx -dump '#{filename}'`
 end

To view html when hitting enter you could set your browser in ~/.mailcap:

 text/html; firefox %s

best,
/p

Excerpts from Steve's message of Wed May 11 14:53:27 +0100 2011:
> Hi,
> 
> A couple days ago, a significant portion of my incoming mail is
> arriving as an HTML attachment only, where previously, HTML formatted
> emails showed up as semi-readable text and also as an attachment.  I
> have not messed with sup recently.
> 
> How do you recommend dealing with HTML attachments?  I hit <enter> on
> the attachment and it says "Couldn't execute view command, viewing as
> text."  Any way to bring this up in a web browser?
> 
> Thanks.
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Steve <[email-masked]>
Date: Wed, 11 May 2011 09:53:27 -0400

Hi,

Thanks.

---

From: Steve <[email-masked]>
Date: Wed, 11 May 2011 10:59:09 -0400

On Wed, May 11, 2011 at 10:13 AM, Mark Alexander <[email-masked]> wrote:
> Excerpts from Steve's message of Wed May 11 09:53:27 -0400 2011:
>> How do you recommend dealing with HTML attachments?
>
> I use a text-mode browser called w3m to view HTML.  Sup will invoke it
> as necessary (on Ubuntu, at least) if you put the following in your
> ~/.mailcap file:
>
> text/html; /usr/bin/w3m -o confirm_qq=false -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
>

Thanks for the tip!

However, it's still telling me it can't execute the command.

Prior to this, I had no .mailcap.  I created one and restarted sup.
Do I need to somehow tell sup about this?

Thanks.

---

From: Steve <[email-masked]>
Date: Wed, 11 May 2011 11:40:37 -0400

> To view html when hitting enter you could set your browser in ~/.mailcap:

The mime-decode.rb hook does the trick.

Still can't get sup to invoke w3m when I hit <enter> on HTML
attachments.  W3m is installed.  Something isn't hooked up correctly.
But oh well, we'll save that for the next guy.

Thanks, all.

---

From: Mark Alexander <[email-masked]>
Date: Wed, 11 May 2011 10:13:49 -0400

---

From: Mark Alexander <[email-masked]>
Date: Wed, 11 May 2011 11:24:28 -0400

> However, it's still telling me it can't execute the command.

You may need to install w3m and possibly run-mailcap (part of the mime-support
package on Ubuntu).
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Tero Tilus <[email-masked]>
Date: Fri, 13 May 2011 10:39:34 +0300

Mark Alexander, 2011-05-12 16:21:
> I also run sup in screen, sometimes from a remote system via ssh, so
> that's why I chose w3m as the mailcap'd browser.

I do w3m too.  Most (~90%) of the time it does exactly what I want,
but sometimes (say with images, pdf:s and strangely laid out html
documents) an url to the document is a must.

-- 
Tero Tilus ## 050 3635 235 ## http://tero.tilus.net/
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Matías Aguirre <[email-masked]>
Date: Wed, 11 May 2011 11:30:22 -0300

> text."  Any way to bring this up in a web browser?

Add this to your ~/.mailcap

text/html; /path/to/browser '%s'; description=HTML Text; nametemplate=%s.html

-- 
Matías Aguirre <[email-masked]>
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Mark Alexander <[email-masked]>
Date: Thu, 12 May 2011 09:21:40 -0400

Excerpts from Tero Tilus's message of Thu May 12 04:30:39 -0400 2011:
> I run sup screened in a vps box, so mailcapping html to browser is not
> an option for me.

---

From: Patrick Totzke <[email-masked]>
Date: Fri, 13 May 2011 10:55:17 +0100

> documents) an url to the document is a must.

I can highly recommend lynx'x dump mode for inline html: it 
produces a "references" suffix which displays all URI's from the
links in the document. This works great con combination with 
urxvt's url-select script.
/p
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Tero Tilus <[email-masked]>
Date: Thu, 12 May 2011 11:30:39 +0300

> How do you recommend dealing with HTML attachments?

Primary options were already introduced by others.

I use publish hook to view attachments (and html-messages) in browser.
Just hit P and click the link.

I run sup screened in a vps box, so mailcapping html to browser is not
an option for me.  My publish.rb looks like this

http://pastie.org/private/ki9luv8yfqjknbhheomi1g

Feel free to use.