Re: mime type when adding attachment

2008-11-03 Thread Christian Mongeau
On 2008-11-03, bill lam wrote:
 When I attach an excel file, its mime type is automatically set
 to
 application/excel, while recipient has no problem (they use
 outlook), my mailcap has not associate that with any spreadsheet
 program, thus mutt cannot open it.  My question is how does mutt
 determine mime type when adding attachment so that I could
 change that
 for excel file to application/vnd.ms-excel  which seem
 recognised by
   both gnumeric and openoffice.

Chapter 5 of the manual deals with MIME:
http://www.mutt.org/doc/devel/manual.html#mimesupport

In particular, 2. MIME Type configuration with mime.types
(http://www.mutt.org/doc/devel/manual.html#mime-types) says:
When you add an attachment to your mail message, Mutt searches
your personal mime.types file at ${HOME}/.mime.types, and then
the system mime.types file at /usr/local/share/mutt/mime.types
or /etc/mime.types

The mime.types file consist of lines containing a MIME type and
a space separated list of extensions. For example:

application/postscript  ps eps
application/pgp pgp
audio/x-aiffaif aifc aiff

[...]

You can change the MIME type that Mutt assigns to an attachment by
using the edit-type command from the compose menu (default: ^T).
[...] or by modifying the mime.types file.

Regards.

-- 
SDF Public Access UNIX System - http://sdf.lonestar.org


Re: mime type when adding attachment

2008-11-03 Thread Christian Mongeau
On 2008-11-03, bill lam wrote:
 On Mon, 03 Nov 2008, Christian Mongeau wrote:
  Chapter 5 of the manual deals with MIME:
  http://www.mutt.org/doc/devel/manual.html#mimesupport
  
  In particular, 2. MIME Type configuration with mime.types
  (http://www.mutt.org/doc/devel/manual.html#mime-types)
[...]
 
 I checked again that there is no 
 ~/.mime.types
 /usr/local/share/mutt/mime.types
 /usr/share/mutt/mime.types
 
 There are
 /etc/mime.types  which contains
 application/vnd.ms-excelxls xlb xlt
 
 /usr/etc/mime.types  ??? which contains
 application/excel   xls
 
 Apparently mutt get mime type from /usr/etc/mime.types any idea why
 there is such a file and why mutt read from it, instead of
 /etc/mime.types as mentioned inside mutt documentation?

AFAIK there shouldn't be a /usr/etc/mime.types because it's not
FHS-compliant:
[...] /usr/etc is still not allowed: programs in /usr should
place configuration files in /etc.
(http://www.pathname.com/fhs/pub/fhs-2.3.html#USRLOCALLOCALHIERARCHY)

Well, ehm, they're simply guidelines...

Anyway, you can create a .mime.types in your $HOME with the line:
application/vnd.ms-excelxls

Regards.

-- 
SDF Public Access UNIX System - http://sdf.lonestar.org


Re: mime type when adding attachment

2008-11-03 Thread bill lam
On Mon, 03 Nov 2008, Christian Mongeau wrote:
 Chapter 5 of the manual deals with MIME:
 http://www.mutt.org/doc/devel/manual.html#mimesupport
 
 In particular, 2. MIME Type configuration with mime.types
 (http://www.mutt.org/doc/devel/manual.html#mime-types) says:
 When you add an attachment to your mail message, Mutt searches
 your personal mime.types file at ${HOME}/.mime.types, and then
 the system mime.types file at /usr/local/share/mutt/mime.types
 or /etc/mime.types
 
 The mime.types file consist of lines containing a MIME type and
 a space separated list of extensions. For example:
 
 application/postscript  ps eps
 application/pgp pgp
 audio/x-aiffaif aifc aiff
 
 [...]
 
 You can change the MIME type that Mutt assigns to an attachment by
 using the edit-type command from the compose menu (default: ^T).
 [...] or by modifying the mime.types file.

Thanks Christian. 

I checked again that there is no 
~/.mime.types
/usr/local/share/mutt/mime.types
/usr/share/mutt/mime.types

There are
/etc/mime.types  which contains
application/vnd.ms-excelxls xlb xlt

/usr/etc/mime.types  ??? which contains
application/excel   xls

Apparently mutt get mime type from /usr/etc/mime.types any idea why
there is such a file and why mutt read from it, instead of
/etc/mime.types as mentioned inside mutt documentation?

I use ubuntu if that matters.

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3


Re: mime type when adding attachment

2008-11-03 Thread bill lam
On Mon, 03 Nov 2008, Christian Mongeau wrote:
 AFAIK there shouldn't be a /usr/etc/mime.types because it's not
 FHS-compliant:
 [...] /usr/etc is still not allowed: programs in /usr should
 place configuration files in /etc.

I checked the mutt source and found that it set sysconfdir to
prefix/etc inside configure, since my prefix=usr so that it looks for
the directory /usr/etc, I'm not sure if my configure is problematic or
mutt use lagacy autoconf that generate the configure. Anyway this is
different from the mutt documentation.

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3


mime type when adding attachment

2008-11-02 Thread bill lam
When I attach an excel file, its mime type is automatically set to
application/excel, while recipient has no problem (they use
outlook), my mailcap has not associate that with any spreadsheet
program, thus mutt cannot open it.  My question is how does mutt
determine mime type when adding attachment so that I could change that
for excel file to application/vnd.ms-excel  which seem recognised by
  both gnumeric and openoffice.


relevant portions of my /etc/mailcap

application/vnd.ms-excel; gnumeric '%s'; edit=gnumeric '%s'; description=MS 
Excel spreadsheet; test=test -n $DISPLAY; nametemplate=%s.xls
application/x-excel; gnumeric '%s'; edit=gnumeric '%s'; description=MS Excel 
spreadsheet; test=test -n $DISPLAY; nametemplate=%s.xls
application/x-ms-excel; gnumeric '%s'; edit=gnumeric '%s'; description=MS 
Excel spreadsheet; test=test -n $DISPLAY; nametemplate=%s.xls
application/x-msexcel; gnumeric '%s'; edit=gnumeric '%s'; description=MS Excel 
spreadsheet; test=test -n $DISPLAY; nametemplate=%s.xls
application/x-xls; gnumeric '%s'; edit=gnumeric '%s'; description=MS Excel 
spreadsheet; test=test -n $DISPLAY; nametemplate=%s.xls
application/x-dos_ms_excel; gnumeric '%s'; edit=gnumeric '%s'; description=MS 
Excel spreadsheet; test=test -n $DISPLAY; nametemplate=%s.xls

application/vnd.ms-excel.sheet.macroEnabled.12; soffice -no-oosplash -calc 
'%s'; edit=soffice -no-oosplash -calc '%s'; test=test -n $DISPLAY; 
description=Office Open XML Spreadsheet with Macros Enabled; 
nametemplate=%s.xlsm
application/vnd.ms-excel.template.macroEnabled.12; soffice -no-oosplash -calc 
'%s'; edit=soffice -no-oosplash -calc '%s'; test=test -n $DISPLAY; 
description=Office Open XML Spreadsheet Template with Macros Enabled; 
nametemplate=%s.xltm
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; soffice 
-no-oosplash -calc '%s'; edit=soffice -no-oosplash -calc '%s'; test=test -n 
$DISPLAY; description=Office Open XML Spreadsheet; nametemplate=%s.xlsx
application/vnd.openxmlformats-officedocument.spreadsheetml.template; soffice 
-no-oosplash -calc '%s'; edit=soffice -no-oosplash -calc '%s'; test=test -n 
$DISPLAY; description=Office Open XML Spreadsheet Template; 
nametemplate=%s.xltx
application/vnd.lotus-1-2-3; soffice -no-oosplash -calc '%s'; edit=soffice 
-no-oosplash -calc '%s'; test=test -n $DISPLAY; description=Lotus 1-2-3 
spreadsheet; nametemplate=%s.123
application/vnd.ms-excel; soffice -no-oosplash -calc '%s'; edit=soffice 
-no-oosplash -calc '%s'; test=test -n $DISPLAY; description=Microsoft Excel 
Document; nametemplate=%s.xls
application/msexcel; soffice -no-oosplash -calc '%s'; edit=soffice -no-oosplash 
-calc '%s'; test=test -n $DISPLAY; description=Microsoft Excel Document; 
nametemplate=%s.xls

-- 
regards,

GPG key 1024D/4434BAB3 2008-08-24
gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3