public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Henry Gebhardt <hsggebhardt@googlemail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] OT: How to make mutt open files by *EXTENSION*?
Date: Tue, 24 Jul 2012 09:49:28 +0200	[thread overview]
Message-ID: <20120724074928.GA4408@bimsstein> (raw)
In-Reply-To: <20120723221345.GB12491@ns1.bonedaddy.net>

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


      parent reply	other threads:[~2012-07-24  7:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Henry Gebhardt [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120724074928.GA4408@bimsstein \
    --to=hsggebhardt@googlemail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox