The Section Decoding Messages with mimecat gives an overview of this script. Here is the mimecat script (you might want to open it in a separate browser window). To install it, see the Section Programs in This Book's Archive.
mimecat writes certain MIME content-types to the standard output. You have to configure it to output the types that you want to be output. The file named by $profile contains a MIME profile; it writes the contents you choose to standard output. Contents not listed will use default rules in your MH profile or the system mhn_defaults or mhn.defaults file. Why? As explained in the Section MIME Profiles, mhn checks three profiles for an mhn-store- entry. (This script depends on nmh's compatibility with old MH syntax.) If the profile in mimecat doesn't write the content to standard output, mhn will use an entry from another profile. Because those other entries probably won't write to standard output, as you want, you need to be sure that mimecat has entries in its $profile for all types you want to output. It's ugly, but it works.
mhn -store is verbose; it always tells you what it's doing. So mimecat grabs the standard error output from mhn -store. mimecat outputs any lines from mhn that don't seem to be about storing to standard output. That is, mimecat tries to delete informational messages but show errors. You may also need to tweak this part of the script, especially if you're using nmh and its MH compatibility or the messages it prints are changed.
This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. It is freely available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see COPYING.
Copyright © 1991, 1992, 1995 O'Reilly Media, Inc.
Copyright © 1996, 1997, 1999, 2000, 2002, 2004 Jerry Peek
Last modified: 2006-05-31 15:13:43 -0700