procmail
[Top] [All Lists]

Re: mime-decode.rc

1997-05-28 08:58:00
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. 

:0
* ^Content-Transfer-Encoding
{
    mime_decode_encoding = `formail -zx Content-Transfer-Encoding`

This could probably be pared down to

    :0
    * ^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>

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