<<< Date Index >>>     <<< Thread Index >>>

Re: mailcap question



On 2004-09-06, "Wilkinson, Alex" <alex.wilkinson@xxxxxxxxxxxxxxxxxxx> wrote:
> Hi all,
> 
> I have received a Microsoft Excel spreadsheet. Typically I open these via
> gnumeric. 
> 
> I have the following in my mailcap file:
> 
>       application/excel;  gnumeric %s; test=test -n "$DISPLAY";
> 
> And the following in my mime-types file:
> 
>       application/excel          xls
> 
> The problem:
> 
> The email I have received is definitely an excel spreadsheet but has the
> mime-type of: 
> 
>        application/octet-stream;
> 
> Question: Why doesn't mutt recognize the mime type to be of type 
> application/excel ?

It's the responsibility of the sending user agent to determine the
MIME type of an attachment and to properly identify the type in the
Content-Type header.  Some user agents don't do this properly and
instead identify attachments as Content-Type:
application/octet-stream, which is the MIME default type for
attachments of unknown type.

The receiving user agent shouldn't have to do any more than read the
Content-Type of an attachment and consult the mailcap file to
determine the program to be used to display the attachment.

Mutt does provide a workaround to handle attachments identified as
application/octet-stream.  If you add this line to your muttrc,

    mime_lookup application/octet-stream

mutt will use the extension of the attachment's file name to find
the associated content type in the mime.types file, then use that
content type when searching the mailcap file to find the display
program.

>         Correct me if I'm wrong, but I thought that a message is assigned a
>         particular MIME-type based upon what is in your mime-type file.

The sending user agent may consult this file to determine the
content type to give to an attached file based on the file's
extension, but the receiving user agent should not.  Mutt's
mime_lookup command gives users the option of using the mime.types
file to determine the actual type of application/octet-stream
attachments and so save users the continual frustration of dealing
with certain perpetually misconfigured mailers.

HTH,
Gary

-- 
Gary Johnson                               | Agilent Technologies
garyjohn@xxxxxxxxxxxxxxx                   | Wireless Division
http://www.spocom.com/users/gjohnson/mutt/ | Spokane, Washington, USA