On Wed, 28 May 1997 10:46:11 -0400,
Roderick Schertler <roderick(_at_)argon(_dot_)org> wrote:
Here's a file from my procmaillib. For a recent project I needed to
decode whatever standard MIME encoding the body was in, including this
file does that.
The potential problem is that it won't take care of multipart
messages, which is what a lot of the attached stuff gets sent as.
This is fine for a simple decoder and a demonstration of how to do
nifty things in Procmail, but you should probably revert to a full
MIME decoder app if you want robustness.
I don't think it would be impossible to do a good deal of all MIME
decoding in a Procmail script, but there's a lot of things in the MIME
spec that complicates things.
mime_decode_encoding = `formail -zx Content-Transfer-Encoding`
This could probably be pared down to
* ^Content-transfer-encoding:[ ]*\/.*
mime_decode_encoding = $MATCH
Hope this helps,
/* era */
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r. <http://www.iki.fi/~era/>
* Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>