I use mutt via ssh and neither need nor want MIME enhancements,
just the text. Can mutt display the text portion of the message
alone? If the text is of interest, I can always go back for the
formatting and MIME enhancements. It's common these days to get
a few words of meaningful message buried in kilobytes of HTML.
On 2021-10-10, bob prohaska wrote:
I use mutt via ssh and neither need nor want MIME enhancements, just
the text. Can mutt display the text portion of the message alone? If
the text is of interest, I can always go back for the formatting and
MIME enhancements. It's common these days to get a few words of
meaningful message buried in kilobytes of HTML.
This sounds like what mutt does already: display the plain text, let
you know the other parts are there. If you want the useful content out
of an HTML message,
auto_view text/html
will use your mailcap (and a text-mode web browser such as elinks) to
display HTML inline as though it were useful text. Searching for
auto_view in the manual should be helpful.
with <20211010041304.459075189967738@firedrake.org> Roger Bell_West
wrote:
On 2021-10-10, bob prohaska wrote:
I use mutt via ssh and neither need nor want MIME enhancements, just
the text. Can mutt display the text portion of the message alone? If
the text is of interest, I can always go back for the formatting and
MIME enhancements. It's common these days to get a few words of
meaningful message buried in kilobytes of HTML.
This sounds like what mutt does already: display the plain text, let
you know the other parts are there. If you want the useful content out
of an HTML message,
auto_view text/html
will use your mailcap (and a text-mode web browser such as elinks) to
display HTML inline as though it were useful text. Searching for
auto_view in the manual should be helpful.
Also 'alternative_order' might be needed (unfortunately, this setting is somewhat vaguely documented, and I'm not bothered to find out what are defaults). Or, read whole story in the manual, search for "MIME Multipart/Alternative".
A bit of searching found these instructions for invoking lynx automatically:
https://blog.deadlypenguin.com/2009/04/21/mutt-and-lynx/
It seems to work, but acts automatically. The whole (and possibly futile) point of my enterprise is to avoid involuntary invocation of additional software while viewing untrusted email.
Is there some way to at least give myself a choice?
I tried deleting auto_view from the .muttrc line, but that triggered
an error message. Is there a command that prompts for permission?
Automatically stripping html would be ideal, followed by an option to
invoke an html viewer.
Eric Pozharski <whynot@pozharski.name> wrote:*SKIP*
with <20211010041304.459075189967738@firedrake.org> Roger Bell_West
wrote:
On 2021-10-10, bob prohaska wrote:
I use mutt via ssh and neither need nor want MIME enhancements, just
the text. Can mutt display the text portion of the message alone?
*SKIP*This sounds like what mutt does already: display the plain text, let
you know the other parts are there. If you want the useful content out
of an HTML message,
auto_view text/html
will use your mailcap (and a text-mode web browser such as elinks) to
display HTML inline as though it were useful text. Searching for
auto_view in the manual should be helpful.
Also 'alternative_order' might be needed
Or, read whole story in the manual, search for "MIMEI'm now reduced to reading the mutt manual 8-)
Multipart/Alternative".
I was hopeful there might be a switch in mutt that strips markup.
Invoking a proper html interpreter is more than I think I need.
and in ~/.mailcap have
text/html; /usr/bin/elinks ...
Install the elinks package.
I use mutt via ssh and neither need nor want MIME enhancements,
just the text. Can mutt display the text portion of the message
alone?
Note that "automatically stripping" would itself involve "involuntary invocation of additional software while viewing untrusted email",
violating your wish not to do so.
Rich <rich@example.invalid> wrote:
Can lynx be invoked from the view menu after selecting the subpart?
The idea would be to view everything as plain text, then back up and
apply lynx to the selected sub-part if it seems worthwhile.
I can start lynx from the view menu, but it is oblivious to the
selected subpart.
* bob prohaska, 2021-10-10 01:44 UTC:
I use mutt via ssh and neither need nor want MIME enhancements,
just the text. Can mutt display the text portion of the message
alone?
Yes it can. Note though that for mixed multipart messages often the text/plain part does not match the text/html part, especially in mails
from shitty shops and "enterprise grade" mail systems. So it may be
desirable to be able to choose which.
In your muttrc have
# use mailcap entry for defined types
unset implicit_autoview
unauto_view *
auto_view text/html
alternative_order text/plain text text/html
and in ~/.mailcap have
text/html; /usr/bin/elinks -localhost 1 -no-connect 1 -force-html -dump %s; copiousoutput; description=HTML Text; nametemplate=%s.html
(all on one line).
Install the elinks package. The muttrc alternative_order determines
which part is preferably displayed. The mailcap entry produces a textual
view of the text/html part if there is one present and that then is
displayed by mutt. In the index view or while viewing a message you can
still press 'v' and from the multiparts select either the text/plain or text/html part to view.
Eike Rathke <erack+nutznetz.p@posteo.de> wrote:
* bob prohaska, 2021-10-10 01:44 UTC:
I use mutt via ssh and neither need nor want MIME enhancements,
just the text. Can mutt display the text portion of the message
alone?
Yes it can. Note though that for mixed multipart messages often the text/plain part does not match the text/html part, especially in mails
from shitty shops and "enterprise grade" mail systems. So it may be desirable to be able to choose which.
In your muttrc have
# use mailcap entry for defined types
unset implicit_autoview
unauto_view *
auto_view text/html
alternative_order text/plain text text/html
and in ~/.mailcap have
text/html; /usr/bin/elinks -localhost 1 -no-connect 1 -force-html -dump %s; copiousoutput; description=HTML Text; nametemplate=%s.html
(all on one line).
This combination seems to work nicely. If I just select the whole
message and hit return, mutt displays the plain text. If I use v
to list the attachments, select text/html and hit return, the
browser fires up and shows me the formatted text. That's a bit
nicer than I was originally looking for.
Install the elinks package. The muttrc alternative_order determines
which part is preferably displayed. The mailcap entry produces a textual view of the text/html part if there is one present and that then is displayed by mutt. In the index view or while viewing a message you can still press 'v' and from the multiparts select either the text/plain or text/html part to view.
elinks is turning out to be a problem. It built and installed without complaint, but doesn't run correctly. This is on a Raspberry Pi2B running FreeBSD 12.2. The ports tree is stale, I'll update it and try again later. For now lynx is good enough.
For now lynx is good enough.
Bob, try Links. eLinks is based on it. :)
Ant <ant@zimage.comant> wrote:
For now lynx is good enough.
Bob, try Links. eLinks is based on it. :)
It's in the FreeBSD ports collection, so that should be easy.
A browser is really too capable for my purposes. Browsers, AIUI,
can spawn subordinate programs on the user's behalf, which I'd
like to avoid.
There is a port called html2text, which I know nothing about.
If true to its name, that might come closer to scraping off
the tags so I can see what the email tries to do, without it
being able to actually make good on the goal.
This thread has taught me the essentials, which turn out to be
rather arcane. Now I have to decide just how paranoid to be
about unsolicited email.
Thanks to all who's educated me!
bob prohaska
Well, you need a secure browser which doesn't e.g. let mails "phone
home". I don't know which of the popular text-mode browsers (lynx,
links, elinks, w3m; any others?) do that well.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 68:18:07 |
Calls: | 6,655 |
Calls today: | 1 |
Files: | 12,200 |
Messages: | 5,332,031 |
Posted today: | 1 |