Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #240048

Re: Mutt/Neomutt and mailcap

From Nate Bargmann <n0nb@n0nb.us>
Newsgroups linux.debian.user
Subject Re: Mutt/Neomutt and mailcap
Date 2021-09-16 12:40 +0200
Message-ID <CXWYa-5Gi-7@gated-at.bofh.it> (permalink)
References (2 earlier) <CXHmp-43N-1@gated-at.bofh.it> <CXHFM-4py-17@gated-at.bofh.it> <CXIBQ-4Yd-9@gated-at.bofh.it> <CXKDD-69s-1@gated-at.bofh.it> <CXPtD-DD-1@gated-at.bofh.it>
Organization Amateur Radio!

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

* On 2021 15 Sep 21:36 -0500, David Wright wrote:
> I think what your system is doing is as follows:
> 
> You probably have in your (default) /etc/Muttrc:

In my case, /etc/neomuttrc, and the following does exist.

My assumptions have been that the system RC is ignored when a user's RC
exist.  I am finding this is not entirely true in all cases.

>   # Use mime.types to look up handlers for application/octet-stream. Can
>   # be undone with unmime_lookup.
>   mime_lookup application/octet-stream
> 
> That sends mutt looking in /etc/mime.types where it finds the line:
> 
>   text/x-diff                                     diff patch

> Your attachment had the extension ".patch", so it searches your
> and the system's mailcap files for "text/x-diff", fails to find it,

> and eventually hits the default entry:
> 
>    text/*; less '%s'; needsterminal
> 
> which it obeys.

Exactly, and is followed immediately by:

text/*; view %s; edit=vim %s; compose=vim %s; test=test -x /usr/bin/vim; needsterminal

which I have now added to  ~/.mailcap as:

text/x-diff; view %s; edit=vim %s; compose=vim %s; test=test -x /usr/bin/vim; needsterminal

and now the offending attachment is opened in Vim from the view
attachments screen when I press Enter on it.

> BTW, your shell command,
> 
>   !see --norun application/octet-stream:/dev/null
> 
> will give you an answer in the context of a subshell, and
> not necessarily in the context of mutt itself. For example,
> on my shell:
> 
> $ see --norun text/html:/dev/null
> /usr/bin/sensible-browser /dev/null
> $ 
> 
> but the special mailcap prioritised by my mutt defines:
> 
>   text/html; /usr/bin/lynx -force-html -localhost -stdin
> 
> and any subshell would know nothing about that.
> 
> About the ";", it could also be an accidentally unshifted ":",
> and it might be easy to mis-remember:
> 
>     ":" is mutt's keystroke for entering mutt commands, whereas
>     "!" is mutt's keystroke for entering shell commands.

Thanks for the helpful pointers through the maze!

The problem is that I visit something like this once about every several
years and it's all new again.  Sigh...

Finally, the Web mailer that assigned application/octet-stream may not
be that far off if it is assuming the recipient's MUA and MIME handling
is configured correctly, which it actually is.  I was just a bit annoyed
at the end result and now I have it set per my preference.

- Nate

-- 
"The optimist proclaims that we live in the best of all
possible worlds.  The pessimist fears this is true."
Web: https://www.n0nb.us
Projects: https://github.com/N0NB
GPG fingerprint: 82D6 4F6B 0E67 CD41 F689 BBA6 FB2C 5130 D55A 8819

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Mutt/Neomutt and mailcap Nate Bargmann <n0nb@n0nb.us> - 2021-09-15 15:40 +0200
  Re: Mutt/Neomutt and mailcap Jonathan Dowland <jon+debian-user@dow.land> - 2021-09-15 17:50 +0200
    Re: Mutt/Neomutt and mailcap Nate Bargmann <n0nb@n0nb.us> - 2021-09-15 20:00 +0200
      Re: Mutt/Neomutt and mailcap Greg Wooledge <greg@wooledge.org> - 2021-09-15 20:20 +0200
        Re: Mutt/Neomutt and mailcap Nate Bargmann <n0nb@n0nb.us> - 2021-09-15 20:20 +0200
        Re: Mutt/Neomutt and mailcap <tomas@tuxteam.de> - 2021-09-15 21:20 +0200
          Re: Mutt/Neomutt and mailcap Nate Bargmann <n0nb@n0nb.us> - 2021-09-15 23:30 +0200
            Re: Mutt/Neomutt and mailcap David Wright <deblis@lionunicorn.co.uk> - 2021-09-16 04:40 +0200
              Re: Mutt/Neomutt and mailcap <tomas@tuxteam.de> - 2021-09-16 08:30 +0200
              Re: Mutt/Neomutt and mailcap Nate Bargmann <n0nb@n0nb.us> - 2021-09-16 12:40 +0200
                Re: Mutt/Neomutt and mailcap David Wright <deblis@lionunicorn.co.uk> - 2021-09-19 06:50 +0200
        Re: Mutt/Neomutt and mailcap Jonathan Dowland <jon+debian-user@dow.land> - 2021-09-16 09:50 +0200
          Re: Mutt/Neomutt and mailcap <tomas@tuxteam.de> - 2021-09-16 11:10 +0200
          Re: Mutt/Neomutt and mailcap Greg Wooledge <greg@wooledge.org> - 2021-09-16 13:50 +0200
            Re: Mutt/Neomutt and mailcap Jonathan Dowland <jon+debian-user@dow.land> - 2021-09-18 00:30 +0200
  Re: Mutt/Neomutt and mailcap Andrei POPESCU <andreimpopescu@gmail.com> - 2021-09-16 09:40 +0200
    Re: Mutt/Neomutt and mailcap Nate Bargmann <n0nb@n0nb.us> - 2021-09-16 12:10 +0200

csiph-web