FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 07-23-2012, 09:43 PM
"Walter Dnes"
 
Default OT: How to make mutt open files by *EXTENSION*?

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>
 
Old 07-23-2012, 10:13 PM
Todd Goodman
 
Default OT: How to make mutt open files by *EXTENSION*?

* 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
 
Old 07-24-2012, 04:37 AM
Terry
 
Default OT: How to make mutt open files by *EXTENSION*?

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
 
Old 07-24-2012, 07:49 AM
Henry Gebhardt
 
Default OT: How to make mutt open files by *EXTENSION*?

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
 
Old 07-24-2012, 06:00 PM
Todd Goodman
 
Default OT: How to make mutt open files by *EXTENSION*?

* 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
 
Old 07-24-2012, 07:01 PM
Philip Webb
 
Default OT: How to make mutt open files by *EXTENSION*?

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
 
Old 07-24-2012, 10:00 PM
Grant Edwards
 
Default OT: How to make mutt open files by *EXTENSION*?

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 ...
 

Thread Tools




All times are GMT. The time now is 12:56 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org