Sorry for not snipping more, all the old text is really needed to
understand the answer.

Jan Stary wrote on Fri, Feb 25, 2011 at 02:36:52PM +0100:
> On Feb 24 10:57:26, Joachim Schipper wrote:
>> On Thu, Feb 24, 2011 at 10:11:22AM +0100, Jan Stary wrote:
>>> On Feb 09 17:56:59, Ingo Schwarze wrote:

>>>> text/html; /usr/bin/lynx -stdin -force_html -dump ; copiousoutput
[...]

>>> I have been using (variations of) these for years in my ~/.mailcap,
>>> which made mutt(1) launch lynx(1) on the html attachments. Since
>>> I upgraded to 
>>> 
>>> OpenBSD 4.8-current (GENERIC) #448: Fri Oct 22 09:43:05 MDT 2010
>>>     dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
>>> 
>>> with mutt-1.5.21p0, it no longer works.
>>> (Should I take this to ports?)
>>> 
>>> Trying to view a HTML attachment from the attachment menu
>>> results in the attachment being displayed by mutt's internal
>>> viewer. I stripped my ~/.mailcap to the minimum suggested by
>>> http://www.mutt.org/doc/manual/manual-5.html#ss5.3
>>> 
>>>     text/html; lynx %s ; nametemplate=%s.html
>>> 
>>> and even that does not work. It seems like my ~/.mailcap is ignored.
>>> (Copying to /etc/mailcap doesn't seem to make any difference.)
>>> 
>>> Does anyone have a hint of what could be causing this?

>> text/html is usually in Mutt's auto_view list; auto_view stuff is
>> automatically piped through any viewer with "copiousoutput" set,

> Yes, but that's not the issue here. I don't want the html attachments to
> be autoviewed; in fact, I have 'set implicit_autoview=no' in ~/.muttrc
 
>> whereas non-"copiousoutput" entries are only used if you explicitly open it
>> ('v' -> select item -> 'm').

> This is what I want; and in fact, it does work, when I explicitly open
> them with 'v' -> select  -> 'm'; until now,, I have been explicitly
> opening the attachments I wanted to view with 'v' -> select -> Enter.
> That's what stooped working; opening them with 'm' runs the correct
> (~/.mailcap) lynx command over them.

Reading manual.txt, i understand this is intended behaviour.
If i understand correctly, with "set implicit_autoview=no",
the "auto_view" list is used for two purposes:
 - When viewing the message as a whole, to decide whether a given
   MIME part should be displayed inline after running it through
   the MIME handler,
 - and from the "v"iew menu, when selecting a part with "Enter"
   (as opposed to selecting it with "m"), to decide whether to
   use the MIME handler or to display it as raw text using the
   internal pager.
So yes, when you have neither "set implicit_autoview=yes" nor
"auto_view text/html", you have to type "v" "m" to start lynx.

In case this was different in old versions of mutt, it may either
have been a bug or an intentional change of behaviour.

Citations from manual.txt:

  3.110. implicit_autoview
  [...]
   If set to "yes", mutt will look for a mailcap entry with the
   "copiousoutput" flag set for every MIME attachment it doesn't have an
   internal viewer defined for. If such an entry is found, mutt will use
   the viewer defined in that entry to convert the body part to text form.

So conversely, without implicit_autoview, it will only look for mailcap
entries for MIME types listed in auto_view, or when explicitely
requested with "v" "m".

  4. MIME Autoview
  [...]
   In addition to explicitly telling Mutt to view an attachment with the
   MIME viewer defined in the mailcap file from the attachments menu, Mutt
   has support for automatically viewing MIME attachments while in the
   pager.

That's what you ask for when pressing "v" "Enter", so without auto_view,
you will get raw HTML tags displayed in the internal parser, bacause
the MIME handler will not be called.

Yours,
  Ingo

Reply via email to