Discussion:
View HTML without autoview
David Woodfall
2018-03-14 12:53:23 UTC
Permalink
I've just found reason to not autoview HTML and to do it manually with
a bind.

Previously, I used elinks and it works fine with autoview, however
when I try to pipe to it it also renders the headers instead of just
the body.

This is my mailcap:

text/html;elinks %s;nametemplate=%s.html;copiousoutput

Is there a way of replicating that in a bind? What is this template?
David Woodfall
2018-03-14 13:13:42 UTC
Permalink
Post by David Woodfall
I've just found reason to not autoview HTML and to do it manually with
a bind.
Previously, I used elinks and it works fine with autoview, however
when I try to pipe to it it also renders the headers instead of just
the body.
text/html;elinks %s;nametemplate=%s.html;copiousoutput
Is there a way of replicating that in a bind? What is this template?
I've just noticed that there's an unauto_view command. Making a bind
to auto_view and unauto_view works fine.

I'm still curious about how autoview works with elinks and that
nametemplate though.
Ian Zimmerman
2018-03-14 23:01:45 UTC
Permalink
Post by David Woodfall
Post by David Woodfall
Previously, I used elinks and it works fine with autoview, however
when I try to pipe to it it also renders the headers instead of just
the body.
When you try a pipe, is that piping the message (as a pipe command would
do in the index view) or just the html MIME part (as a pipe command in
the attachment view would do)?
Post by David Woodfall
I'm still curious about how autoview works with elinks and that
nametemplate though.
The binding I have for viewing HTML is a macro which opens the
attachment view, searches for the html part and then calls the
view-mailcap command.
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.
David Woodfall
2018-03-14 23:23:58 UTC
Permalink
Post by Ian Zimmerman
Post by David Woodfall
Post by David Woodfall
Previously, I used elinks and it works fine with autoview, however
when I try to pipe to it it also renders the headers instead of just
the body.
When you try a pipe, is that piping the message (as a pipe command would
do in the index view) or just the html MIME part (as a pipe command in
the attachment view would do)?
It does the whole message. I seem to get messages where the entire
message is html with no separate html part. Mostly from ebay.co.uk,
even though I set to receive mail in plain text only.
Post by Ian Zimmerman
Post by David Woodfall
I'm still curious about how autoview works with elinks and that
nametemplate though.
The binding I have for viewing HTML is a macro which opens the
attachment view, searches for the html part and then calls the
view-mailcap command.
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.
David Woodfall
2018-03-14 23:50:35 UTC
Permalink
Post by David Woodfall
Post by Ian Zimmerman
Post by David Woodfall
Post by David Woodfall
Previously, I used elinks and it works fine with autoview, however
when I try to pipe to it it also renders the headers instead of just
the body.
When you try a pipe, is that piping the message (as a pipe command would
do in the index view) or just the html MIME part (as a pipe command in
the attachment view would do)?
It does the whole message. I seem to get messages where the entire
message is html with no separate html part. Mostly from ebay.co.uk,
even though I set to receive mail in plain text only.
Post by Ian Zimmerman
Post by David Woodfall
I'm still curious about how autoview works with elinks and that
nametemplate though.
The binding I have for viewing HTML is a macro which opens the
attachment view, searches for the html part and then calls the
view-mailcap command.
--
Please don't Cc: me privately on mailing lists and Usenet,
if you also post the followup to the list or newsgroup.
To reply privately _only_ on Usenet and on broken lists
which rewrite From, fetch the TXT record for no-use.mooo.com.
Ha. I chatted to ebay tech support today because they
keep sending me these HTML emails even though I have set to receive
plain text. Well they must have changed something because I just had
the first mail since then and there was no body apart from:

[-- This text/html attachment (size 135K bytes) has been deleted --]
[-- on Wed, 14 Mar 2018 23:41:06 +0000 --]

No text attachment or anything else. Fun. Well at least it didn't have
any of those icons that mess up my terminal.
Erik Christiansen
2018-03-15 11:32:47 UTC
Permalink
Post by David Woodfall
Post by Ian Zimmerman
Post by David Woodfall
Previously, I used elinks and it works fine with autoview, however
when I try to pipe to it it also renders the headers instead of just
the body.
When you try a pipe, is that piping the message (as a pipe command would
do in the index view) or just the html MIME part (as a pipe command in
the attachment view would do)?
It does the whole message. I seem to get messages where the entire
message is html with no separate html part. Mostly from ebay.co.uk,
even though I set to receive mail in plain text only.
To strip headers there, is pipe_decode useful? The manual says: "When
set, Mutt will weed headers and will attempt to decode the messages
first." Whether an "ignore *" is also needed to make it weed out all
headers, I haven't tested.

Erik
David Woodfall
2018-03-15 12:35:33 UTC
Permalink
Post by Erik Christiansen
Post by David Woodfall
Post by Ian Zimmerman
Post by David Woodfall
Previously, I used elinks and it works fine with autoview, however
when I try to pipe to it it also renders the headers instead of just
the body.
When you try a pipe, is that piping the message (as a pipe command would
do in the index view) or just the html MIME part (as a pipe command in
the attachment view would do)?
It does the whole message. I seem to get messages where the entire
message is html with no separate html part. Mostly from ebay.co.uk,
even though I set to receive mail in plain text only.
To strip headers there, is pipe_decode useful? The manual says: "When
set, Mutt will weed headers and will attempt to decode the messages
first." Whether an "ignore *" is also needed to make it weed out all
headers, I haven't tested.
Erik
That works quite well and has the benefit of running elinks
interactively, which means I can open links in an external app.

I made a macro:

":unauto_view text/html<enter><exit><display-message>:set pipe_decode<enter><pipe-message>elinks -force-html<enter>:auto_view text/html<enter><exit><display-message>"

The only problem is that for some reason if I run it on an attachment
it marks the attachment for deletion. I can't figure out why it's
doing it. I first used D for the macro, then changed it to Z in case
somehow D was being confused with d, but the problems remains. I only
ever use lowercase d for delete (s+Trash\n). Nothing shows in the help
menu that looks like it would do it.

Loading...