Discussion:
Error: no "view" mailcap rules found for type "text/plain"
Christer Edwards
2011-02-16 06:42:46 UTC
Permalink
I finally managed to find the run-mailcap binary (mime-types package),
but I'm still getting issues with rendering HTML email properly. I get
the error in the subject line as well as another (can't reproduce
without quitting sup).

I wonder if anyone might share their .mailcap file, or suggest any
alternative methods for stripping out the nonsense HTML markup and just
leaving me with plain text.

Thank you,
Christer
Philippe LeCavalier
2011-02-16 14:07:19 UTC
Permalink
Hi Christer.
Excerpts from Christer Edwards's message of Wed Feb 16 01:42:46 -0500 2011:
[...]
Post by Christer Edwards
I wonder if anyone might share their .mailcap file
Here's mine. I just started building it but it's something...BTW Did you look into the mime-decode.rb hook?

cat ../../.mailcap
application/zip; squeeze '%s'
application/pdf; /usr/bin/xpdf '%s'
application/msexcel; gnumeric '%s'
application/html; firefox '%s'
application/vnd.openxmlformats-officedocument.wordprocessingml.document; abiword '%s'

Not certain the last one is 'proper' but it works.
--
Thanks,
Phil
Christer Edwards
2011-02-16 14:46:49 UTC
Permalink
Post by Philippe LeCavalier
Here's mine. I just started building it but it's something...BTW Did you look into the mime-decode.rb hook?
cat ../../.mailcap
application/zip; squeeze '%s'
application/pdf; /usr/bin/xpdf '%s'
application/msexcel; gnumeric '%s'
application/html; firefox '%s'
application/vnd.openxmlformats-officedocument.wordprocessingml.document; abiword '%s'
Not certain the last one is 'proper' but it works.
I tried adding this contents to my file, but I'm still getting the error when selecting an html email attachment:

Couldn't execute view command, viewing as text.

In response to another suggestion, I have not tried the mime hook. I haven't quite been able to make sense of it yet.

Christer
Philippe LeCavalier
2011-02-16 15:28:46 UTC
Permalink
Hi Christer.
Post by Christer Edwards
Post by Philippe LeCavalier
Here's mine. I just started building it but it's something...BTW Did you look into the mime-decode.rb hook?
cat ../../.mailcap
application/zip; squeeze '%s'
application/pdf; /usr/bin/xpdf '%s'
application/msexcel; gnumeric '%s'
application/html; firefox '%s'
application/vnd.openxmlformats-officedocument.wordprocessingml.document; abiword '%s'
Not certain the last one is 'proper' but it works.
Couldn't execute view command, viewing as text.
I think sup always tries to display HTML inline but without the mime-decode.rb hook it will fail(just a guess). Despite the error the
mailcap entry for firefox(assuming you have firefox, if not substitute for sensible-browser) should open.

All mime-decode does is make use of w3m to display the html encoding inline. So you'll need the w3m package for that to work.
Post by Christer Edwards
Christer
--
Thanks,
Phil
Mark Alexander
2011-02-16 16:26:24 UTC
Permalink
Post by Christer Edwards
I wonder if anyone might share their .mailcap file, or suggest any
alternative methods for stripping out the nonsense HTML markup and just
leaving me with plain text.
I use this line in my .mailcap to run w3m on html attachments:

text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
Christer Edwards
2011-02-16 16:39:56 UTC
Permalink
Post by Mark Alexander
Post by Christer Edwards
I wonder if anyone might share their .mailcap file, or suggest any
alternative methods for stripping out the nonsense HTML markup and just
leaving me with plain text.
text/html; /usr/bin/w3m -T text/html '%s'; needsterminal; description=HTML Text; nametemplate=%s.html
This works! I'm not used to w3m, but at least it renders things
properly. Maybe I'll tinker with some other options (lynx, etc).

Thanks for putting me on the right track!

Christer

Loading...