public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] OT: How to make mutt open files by *EXTENSION*?
@ 2012-07-23 21:43 Walter Dnes
  2012-07-23 22:13 ` Todd Goodman
  0 siblings, 1 reply; 7+ messages in thread
From: Walter Dnes @ 2012-07-23 21:43 UTC (permalink / raw
  To: Gentoo Users List

  My ISP emails invoices+receipts as PDF files.  Thay made a change in
the "mime type" earlier this year that makes things more difficult...

Before
======
[-- Attachment #2: blah_blah_blah.pdf --]
[-- Type: application/pdf, Encoding: base64, Size: 47K --]

[-- application/pdf is unsupported (use 'v' to view this part) --]

After
=====
[-- Attachment #2: blah_blah_blah.pdf --]
[-- Type: application/octet-stream, Encoding: base64, Size: 79K --]

[-- application/octet-stream is unsupported (use 'v' to view this part) --]

  With "Type: application/pdf" I hit "v" and epdfview brought up the
document.  With "Type: application/octet-stream" I have to save the
attachment and manually open with epdfview.  Mime-type is useless in
this situation.  Is there a way to force the file to be opened based on
extension rather than mime type?

-- 
Walter Dnes <waltdnes@waltdnes.org>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] OT: How to make mutt open files by *EXTENSION*?
  2012-07-23 21:43 [gentoo-user] OT: How to make mutt open files by *EXTENSION*? Walter Dnes
@ 2012-07-23 22:13 ` Todd Goodman
  2012-07-24  4:37   ` Terry
  2012-07-24  7:49   ` [gentoo-user] " Henry Gebhardt
  0 siblings, 2 replies; 7+ messages in thread
From: Todd Goodman @ 2012-07-23 22:13 UTC (permalink / raw
  To: gentoo-user

* Walter Dnes <waltdnes@waltdnes.org> [120723 17:48]:
>   My ISP emails invoices+receipts as PDF files.  Thay made a change in
> the "mime type" earlier this year that makes things more difficult...
> 
> Before
> ======
> [-- Attachment #2: blah_blah_blah.pdf --]
> [-- Type: application/pdf, Encoding: base64, Size: 47K --]
> 
> [-- application/pdf is unsupported (use 'v' to view this part) --]
> 
> After
> =====
> [-- Attachment #2: blah_blah_blah.pdf --]
> [-- Type: application/octet-stream, Encoding: base64, Size: 79K --]
> 
> [-- application/octet-stream is unsupported (use 'v' to view this part) --]
> 
>   With "Type: application/pdf" I hit "v" and epdfview brought up the
> document.  With "Type: application/octet-stream" I have to save the
> attachment and manually open with epdfview.  Mime-type is useless in
> this situation.  Is there a way to force the file to be opened based on
> extension rather than mime type?
> 
> -- 
> Walter Dnes <waltdnes@waltdnes.org>

I think you could use something like mutt.octet.filter (There's a perl
version at http://www.davep.org/mutt/mutt.octet.filter.pl) to handle
application/octet-stream mime types.

It uses file to try to determine the proper type and can then use
whatever is in your mailcap to determine what to run.

It should be pretty easy to extend it to match on filename if you really
wanted to.

Todd


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] OT: How to make mutt open files by *EXTENSION*?
  2012-07-23 22:13 ` Todd Goodman
@ 2012-07-24  4:37   ` Terry
  2012-07-24 18:00     ` Todd Goodman
  2012-07-24  7:49   ` [gentoo-user] " Henry Gebhardt
  1 sibling, 1 reply; 7+ messages in thread
From: Terry @ 2012-07-24  4:37 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1738 bytes --]


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.

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity. And my typing mistakes. 

Todd Goodman <tsg@bonedaddy.net> wrote:

* Walter Dnes <waltdnes@waltdnes.org> [120723 17:48]:
> My ISP emails invoices+receipts as PDF files. Thay made a change in
> the "mime type" earlier this year that makes things more difficult...
> 
> Before
> ======
> [-- Attachment #2: blah_blah_blah.pdf --]
> [-- Type: application/pdf, Encoding: base64, Size: 47K --]
> 
> [-- application/pdf is unsupported (use 'v' to view this part) --]
> 
> After
> =====
> [-- Attachment #2: blah_blah_blah.pdf --]
> [-- Type: application/octet-stream, Encoding: base64, Size: 79K --]
> 
> [-- application/octet-stream is unsupported (use 'v' to view this part) --]
> 
> With "Type: application/pdf" I hit "v" and epdfview brought up the
> document. With "Type: application/octet-stream" I have to save the
> attachment and manually open with epdfview. Mime-type is useless in
> this situation. Is there a way to force the file to be opened based on
> extension rather than mime type?
> 
> -- 
> Walter Dnes <waltdnes@waltdnes.org>

I think you could use something like mutt.octet.filter (There's a perl
version at http://www.davep.org/mutt/mutt.octet.filter.pl) to handle
application/octet-stream mime types.

It uses file to try to determine the proper type and can then use
whatever is in your mailcap to determine what to run.

It should be pretty easy to extend it to match on filename if you really
wanted to.

Todd


[-- Attachment #2: Type: text/html, Size: 2428 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] OT: How to make mutt open files by *EXTENSION*?
  2012-07-23 22:13 ` Todd Goodman
  2012-07-24  4:37   ` Terry
@ 2012-07-24  7:49   ` Henry Gebhardt
  1 sibling, 0 replies; 7+ messages in thread
From: Henry Gebhardt @ 2012-07-24  7:49 UTC (permalink / raw
  To: gentoo-user

On Mon, Jul 23, 2012 at 06:13:45PM -0400, Todd Goodman wrote:
> * Walter Dnes <waltdnes@waltdnes.org> [120723 17:48]:
> >   My ISP emails invoices+receipts as PDF files.  Thay made a change in
> > the "mime type" earlier this year that makes things more difficult...
> > 
> > Before
> > ======
> > [-- Attachment #2: blah_blah_blah.pdf --]
> > [-- Type: application/pdf, Encoding: base64, Size: 47K --]
> > 
> > [-- application/pdf is unsupported (use 'v' to view this part) --]
> > 
> > After
> > =====
> > [-- Attachment #2: blah_blah_blah.pdf --]
> > [-- Type: application/octet-stream, Encoding: base64, Size: 79K --]
> > 
> > [-- application/octet-stream is unsupported (use 'v' to view this part) --]
> > 
> >   With "Type: application/pdf" I hit "v" and epdfview brought up the
> > document.  With "Type: application/octet-stream" I have to save the
> > attachment and manually open with epdfview.  Mime-type is useless in
> > this situation.  Is there a way to force the file to be opened based on
> > extension rather than mime type?
> 
> I think you could use something like mutt.octet.filter (There's a perl
> version at http://www.davep.org/mutt/mutt.octet.filter.pl) to handle
> application/octet-stream mime types.
> 
> It uses file to try to determine the proper type and can then use
> whatever is in your mailcap to determine what to run.
> 
> It should be pretty easy to extend it to match on filename if you really
> wanted to.

There is also stuff in portage to handle it, like
dev-perl/File-MimeInfo, with which your mailcap can look like this:

    application/octet-stream; mimeopen %s

It uses the file extension by default, but can use magic, too.


Cheers,

Henry


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] OT: How to make mutt open files by *EXTENSION*?
  2012-07-24  4:37   ` Terry
@ 2012-07-24 18:00     ` Todd Goodman
  2012-07-24 19:01       ` Philip Webb
  2012-07-24 22:00       ` [gentoo-user] " Grant Edwards
  0 siblings, 2 replies; 7+ messages in thread
From: Todd Goodman @ 2012-07-24 18:00 UTC (permalink / raw
  To: gentoo-user

* Terry <ny6p01@gmail.com> [120724 00:44]:
> 
> 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.
> 
[..]

Hi Terry,

Yes, it uses mailcap (/etc/mailcap or ~/.mailcap.)

His problem is they've started sending his PDF as
application/octet-stream which needs further investigation to determine
what it really is.

Todd


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-user] OT: How to make mutt open files by *EXTENSION*?
  2012-07-24 18:00     ` Todd Goodman
@ 2012-07-24 19:01       ` Philip Webb
  2012-07-24 22:00       ` [gentoo-user] " Grant Edwards
  1 sibling, 0 replies; 7+ messages in thread
From: Philip Webb @ 2012-07-24 19:01 UTC (permalink / raw
  To: gentoo-user

120724 Todd Goodman wrote:
> His problem is they've started sending his PDF
> as application/octet-stream
> which needs further investigation to determine what it really is.

I suspect the OP's ISP is the same as mine (we live in the same city),
in which case I recommend what I do -- also using Mutt -- ,
ie 'v'iew the list of attachments, 'c'opy the PDF to some local dir
-- I actually keep them all under  ~/biz/ilog/<myname>.pdf  --
& read the details there with Evince (or his choice).
After that, he can simply delete the original e-mail from the ISP.

The value of Gentoo is that you can keep things really simple.

-- 
========================,,============================================
SUPPORT     ___________//___,   Philip Webb
ELECTRIC   /] [] [] [] [] []|   Cities Centre, University of Toronto
TRANSIT    `-O----------O---'   purslowatchassdotutorontodotca



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [gentoo-user] Re: OT: How to make mutt open files by *EXTENSION*?
  2012-07-24 18:00     ` Todd Goodman
  2012-07-24 19:01       ` Philip Webb
@ 2012-07-24 22:00       ` Grant Edwards
  1 sibling, 0 replies; 7+ messages in thread
From: Grant Edwards @ 2012-07-24 22:00 UTC (permalink / raw
  To: gentoo-user

On 2012-07-24, Todd Goodman <tsg@bonedaddy.net> wrote:
> * Terry <ny6p01@gmail.com> [120724 00:44]:
>> 
>> 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.
>> 
> [..]
>
> Hi Terry,
>
> Yes, it uses mailcap (/etc/mailcap or ~/.mailcap.)
>
> His problem is they've started sending his PDF as
> application/octet-stream

AFAICT, that's been standard operating breakage for Outlook+Exchange
since bits were invented.  I've been getting PDF files typed as
application/octet-stream from Outlook users for 15 years.

-- 
Grant Edwards               grant.b.edwards        Yow! I guess it was all a
                                  at               DREAM ... or an episode of
                              gmail.com            HAWAII FIVE-O ...



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-07-24 22:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-23 21:43 [gentoo-user] OT: How to make mutt open files by *EXTENSION*? Walter Dnes
2012-07-23 22:13 ` Todd Goodman
2012-07-24  4:37   ` Terry
2012-07-24 18:00     ` Todd Goodman
2012-07-24 19:01       ` Philip Webb
2012-07-24 22:00       ` [gentoo-user] " Grant Edwards
2012-07-24  7:49   ` [gentoo-user] " Henry Gebhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox