Re: Meta mail help needed

From: Howard Schwartz (theo@ncal.verio.com)
Date: Wed, 29 Jul 1998 14:32:49 -0700 (PDT)

Steven Sawczyn wrote:
>Metamail properly recognizes that the file needs to be started with
>media player, but for some reason, it does not properly asertain
>the correct file name. In stead, it starts media player with a
>file such as 'taaa.aaa'. Since this .aaa extension is not
>registered to media player, it complains of an invalid file type.
>Interestingly enough, if I delete my mailcap entry and attempt to
>manually save the file, I get this 'taaa.aaa' as the suggested
>"default" file name.
>
>My mailcap file is very simple. The entry in question is:
>audio/wav; mplayer %s
>
>In my yarn config file, I have the 'decode-mime=metamail %f' as
>suggested.

Im afraid you have run up against a bug in yarn: Yarn passes an
article or message to an external program by writing the article/message
to a temporary file, which it names with a ``random'' file name. I
had thought yarn generates lots of these names, but I too have a couple
of files called, ``taaa.aaa'' lying around in various directories.

Now metamail figures out what kind of file you have by reading the
``Content Type'' line WITHIN your mail message, not by reading the
suffix of the filename. But yarn is not smart enough to read this
same line, and give the filename it saves the appropriate suffix,
such as ``html'', ``gif'' of ``wav''.

So yarn saves a file called taaa.aaa; metamail passes this file to
an audio program. But the audio program figures out how to process
the file from its filename suffix -- which is always wrong, because
yarn does not pay attention to file types when it names temp files.

For this reason, programs that recognize types of files from file names
do not work with yarn, without some precautions. What to do? One strategy
is to redefine the mailcap line ,something like:

audio/wav; mplayer.bat %s

Inside mplayer.bat you put:

rename %1 tmpfile.wav
mplayer tmpfile.wav
del tmpfile.wav

Basically this renames yarn's filename to something with ``wav'' at the
end, and sends the new filename to mplayer. If mailcap does not like bat
files try a doskey alias, to convert the bat file to a com file. The
strategy wont work if yarn uses some low level dos interrupt, instead of
invoking the DOS command.com shell, so it can read filenames etc.

Another idea is to see if yarn always calls these things, taa.aaa. If
so, and if mplayer permits, simply define ``aaa'' to it as a sound file.
Anyway, you see what has to get done.

Good luck,

the simplist