mhonarc-users

MHonArc for straight MIME decoding (was Re: readmail.pl)

1997-06-05 09:55:53
can readmail.pl, qprint.pl, and base64.pl be used to create a simple script
to parse a unix mailbox file and dump each message into a .txt file, and
each attatchment into it's appropriate filename?  i've been trying to
figure out the easiest way to do this... any help you could give would be
appreciated.

Yes.  If you read the comments in readmail.pl, you can see what you
need to do to.  You basically will have to hook in your own filter
routines and auxillary routines to override the defaults in
readmail.pl.

Another trick is to use MHonArc and register the mhexternal.pl
for all media types (except multipart types).  This way, all
real message data will be extracted to external files and you
can delete the msg*.html and MHonArc archive files if you
do not need them.  The following resources may due what you want:

<NOMAIN>
<NOTHREAD>
<MIMEFILTERS override>
application/*:m2h_external'filter:mhexternal.pl
image/*:m2h_external'filter:mhexternal.pl
audio/*:m2h_external'filter:mhexternal.pl
text/*:m2h_external'filter:mhexternal.pl
model/*:m2h_external'filter:mhexternal.pl
video/*:m2h_external'filter:mhexternal.pl
message/*:m2h_external'filter:mhexternal.pl
</MIMEFILTERS>
<MIMEARGS>
m2h_external'filter: usename
</MIMEARGS>

The "usename" argument tells MHonArc to use any filename specification
in the message for attachments.

This trick may not be the perfect solution for you, but it
could be close, and you will not need to do any programming.
There maybe a problem with associating attachments with the
corresponding txt files.  You can try the -single option for
each message as an alternative.

        --ewh

<Prev in Thread] Current Thread [Next in Thread>