On Sat, May 05, 2001 at 07:49:40AM +0100, Viktor Lakics wrote:
> Using staroffice is a horror idea - at least to me...:-)). What do
> you want to see in those emails? Mutt is an email client, very fast,
> staroffice is *BIGGG* and *SLOOOOW*. I can imagine myself waiting
> 30-40 sec for some stupid email to come up...How can you survive?
[...]
> MSWORD: the way is to convert it to text: for this you need
> wordview package (find it on the nearest linux mirror)
[...]

An alternative to wordview is catdoc available from
http://www.fe.msk.ru/~vitus/catdoc/ (and it may well be part of
whatever Linux distribution you're using).  Just install it and shove
the following line in your .mailcap:

  application/msword; catdoc %s; copiousoutput

and this in your .muttrc:

  auto_view application/msword

I've noticed that a lot of broken Windows mailers set the MIME type on
Word documents to "application/octet-stream".  As this is a kind of
catch-all or last resort MIME type it doesn't really tell you much
about what the content actually is.  So if you want to handle this
gracefully you could use the following in your .mailcap:

  application/octet-stream; any2ascii %s; copiousoutput

and this in your .muttrc:

  auto_view application/octet-stream

where any2ascii is the script below.  This can easily be extended for
other data you receive with a MIME type of "application/octet-stream".
The script depends on the "file" unix command being able to recognise
the format of the actual data.

Mark.



#!/bin/sh

# Guess the MIME type.

if [ $# != 1 ]; then
  echo "USAGE: $0 file"
  exit 1
fi

type=`file -b "${1+$@}"`

if [ "$type" = "Microsoft Word document data" ]; then
  echo "[-- any2ascii: using catdoc to convert '$type' --]"
  echo
  catdoc "${1+$@}"
  echo
  echo "[-- any2ascii: EOF --]"
else
  echo "[-- any2ascii: unsupported file type '$type' --]"
fi

Reply via email to