Gentoo Archives: gentoo-user

From: Terry <ny6p01@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] OT: How to make mutt open files by *EXTENSION*?
Date: Tue, 24 Jul 2012 04:40:16
Message-Id: 43356190-cab8-4985-80aa-ad81181640e2@email.android.com
In Reply to: Re: [gentoo-user] OT: How to make mutt open files by *EXTENSION*? by Todd Goodman
1 I may be mistaken (away from computer atm) but doesn't mutt use mailcap? I believe I use /etc/mailcap but you could also use per user files, /home/user/.mailcap to adjust your attachment handling. There's lots of guides on the web.
2
3 --
4 Sent from my Android phone with K-9 Mail. Please excuse my brevity. And my typing mistakes.
5
6 Todd Goodman <tsg@×××××××××.net> wrote:
7
8 * Walter Dnes <waltdnes@××××××××.org> [120723 17:48]:
9 > My ISP emails invoices+receipts as PDF files. Thay made a change in
10 > the "mime type" earlier this year that makes things more difficult...
11 >
12 > Before
13 > ======
14 > [-- Attachment #2: blah_blah_blah.pdf --]
15 > [-- Type: application/pdf, Encoding: base64, Size: 47K --]
16 >
17 > [-- application/pdf is unsupported (use 'v' to view this part) --]
18 >
19 > After
20 > =====
21 > [-- Attachment #2: blah_blah_blah.pdf --]
22 > [-- Type: application/octet-stream, Encoding: base64, Size: 79K --]
23 >
24 > [-- application/octet-stream is unsupported (use 'v' to view this part) --]
25 >
26 > With "Type: application/pdf" I hit "v" and epdfview brought up the
27 > document. With "Type: application/octet-stream" I have to save the
28 > attachment and manually open with epdfview. Mime-type is useless in
29 > this situation. Is there a way to force the file to be opened based on
30 > extension rather than mime type?
31 >
32 > --
33 > Walter Dnes <waltdnes@××××××××.org>
34
35 I think you could use something like mutt.octet.filter (There's a perl
36 version at http://www.davep.org/mutt/mutt.octet.filter.pl) to handle
37 application/octet-stream mime types.
38
39 It uses file to try to determine the proper type and can then use
40 whatever is in your mailcap to determine what to run.
41
42 It should be pretty easy to extend it to match on filename if you really
43 wanted to.
44
45 Todd

Replies

Subject Author
Re: [gentoo-user] OT: How to make mutt open files by *EXTENSION*? Todd Goodman <tsg@×××××××××.net>