28-Mar-02 at 09:11, [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote :
> I know how to read Word and RTF files using things like catdoc, unrtf,
> and so on.  But all of these do either Word or RTF but not both.
> In an ideal world the MIME type and the filename extension would
> always be right.  But I have recieved some email where an RTF file
> has a '.doc' extension and an 'application/msword' mime type (probably
> because of the extension).  Other than educating the other user,
> what is best way to handle this?  I just want to dump the file
> to the terminal as plain text.

If MIME types are broken, then you need something like mime magic
http://developer.gnome.org/doc/API/libgnome/gnome-gnome-mime.html

or something along those lines - basically, peeking into the contents of
the file's headers to find out what it really is.

Then you have to hack a new MIME type into the headers of the email with
procmail so that it works properly, because AFAIK Mutt will just obey
.mailcap - or maybe you can hack .mailcap itself but I don't know. I
*think* Mutt reads mailcap when you try to view an attachment, so maybe
you can dynamically hack mailcap. Lots of hacking needed.

Simon.

-- 
[Simon White. vim/mutt. [EMAIL PROTECTED] GIMPS:58.86% see www.mersenne.org]
           /"\    ASCII Ribbon Campaign
           \ /    Respect for open standards
            X     No HTML/RTF in email
           / \    No M$ Word docs in email

Reply via email to