MIME decoding via metamail
Jens Peter Secher <[email protected]>
| Newsgroups | gmane.mail.ifile.general |
|---|---|
| Organization | DIKU |
| Message-ID | <[email protected]> |
I have played with using metamail as a preprocessor for ifile, that
is, to get metamail to decode attachments for me. The following seems
to work: Pipe each message through the command
KEYHEADS='*' MAILCAPS=mailcap metamail -d 2>&1
(assuming korn-like shell), where "mailcap" is the file
# All text is simply copied.
text/*; cat %s
# All other things are represented as "encodedinlined<type>"
image/*; echo encodedinlined%t |Â tr -d -c '[:alpha:]'
application/*; echo encodedinlined%t |Â tr -d -c '[:alpha:]'
audio/*; echo encodedinlined%t |Â tr -d -c '[:alpha:]'
message/*; echo encodedinlined%t |Â tr -d -c '[:alpha:]'
such that all headers and printable parts of the email will be output
on stdout, including decoding errors. Unprintable parts are output as
a string
encodedinlined<type>
where <type> is the MIME type, for example,
encodedinlinedimagejpg .
I am not sure about the message/* type (I just looked in my own
/etc/mailcap file). Does anyone with a better understanding of
mailcap files have a better solution? Why can't I write
*; echo encodedinlined%t |Â tr -d -c '[:alpha:]'
instead of repeating similar lines?
--
Jens Peter Secher
_____________________________________________________________________
[email protected] - http://www.diku.dk/~jpsecher - (+45) 35 32 14 08
_OpenPGP fingerprint DD6A 05B0 174E BFB2 D4D9 B52E 0EE5 978A FE63 E8A1_
--> http://randomfoo.net/oscon/2002/lessig/free.html <--