NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: mailcap and Microsoft OOXML



Greg Troxel wrote in <smu7ecwyy8w.fsf%linuxpal.mit.edu@localhost>:
 |steve%prd.co.uk@localhost (Steve Blinkhorn) writes:
 |> Can a mailcap entry make an attachment with these headers:
 |>
 |> Content-Type: application/octet-stream
 |> Content-Transfer-Encoding: base64
 |> Content-Description: Microsoft OOXML
 |> Content-Disposition: attachment; filename="acctkey.xlsx"
 |>
 |> be read with scalc?   More generally, is there a way of parsing the
 |> Content-Description header along with the Content-Type to cope with
 |> application/octet-stream attachyments?  I get a lot of spreadsheet
 |> attachments, some of which start up scalc and some don't and have to
 |> be manually saved and opened outside the mail reader.
 |
 |My impression is that
 |
 |  it's common but technically  buggy of the sender to use octet-stream
 |  instead of the actual content type

..which must be known, of course.  And it depends on the type
itself, whether it is text/ or application/ / image/ etc.

 |  it is highly normal for MUAs to look at the filename and intuit a
 |  replacement content-type and use that

When preparing the message, yes.  When looking at the message
i think the *mime-counter-evidence* is unique to the mailer
i maintain, but i may be mistaken.

 |  I am unaware of the use of the content-description field for automated
 |  processing by MUAs.
 |
 |  Just looking at ~/.mailcap, it's about content-types, so presumably
 |  the extension->content-type mapping is not part of mailcap
 |
 |You didn't mention which ancient mailreader you are using, but the
 |solution for you probably lies in MUA-specific configuration, or perhaps
 |a few lines of code.
 |
 |Either that or you can get everyone you know to send you .ods instead
 |with the right mime-type :-)

RFC 1524 mentions

   [.]Finally, named parameters from the
   Content-type field may be placed in the command execution line using
   "%{" followed by the parameter name and a closing "}" character.  The
   entire parameter should appear as a single command line argument,
   regardless of embedded spaces.  Thus, if the message has a Content-
   type line of:

         Content-type:  multipart/mixed; boundary=42

   and the mailcap file has a line of:

         multipart/*; /usr/local/bin/showmulti \
           %t %{boundary}

   then the equivalent  of  the  following  command  should  be
   executed:

        /usr/local/bin/showmulti multipart/mixed 42

So this could get you going.

  --End of <smu7ecwyy8w.fsf%linuxpal.mit.edu@localhost>

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)


Home | Main Index | Thread Index | Old Index