procmail
[Top] [All Lists]

Re: mime-decode.rc

1997-05-28 09:27:00
    Executive summary: Eriksson doesn't know enough about MIME.

On Wed, 28 May 1997 11:27:45 -0400,
Roderick Schertler <roderick(_at_)argon(_dot_)org> wrote:
On Wed, 28 May 1997 18:08:31 +0300 (EET DST), era eriksson 
<era(_at_)iki(_dot_)fi> said:
On Wed, 28 May 1997 10:46:11 -0400,
Roderick Schertler <roderick(_at_)argon(_dot_)org> wrote:
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,
What do you mean?  Multipart messages cannot have an encoding (other
than 7bit, 8bit or binary) (ref section 6.4 of RFC 2045), so they're
handled just fine.

Ooops, mea culpa. Sorry. I didn't know you weren't allowed to have
encoding on the whole multipart but it does make sense and I'll
readily agree that I should have checked before I put my foot in my
mouth.

My line of reasoning was that if you have a multipart where the
different parts are encoded differently, the script would attempt to
apply the same decoding on them all.
  This might still happen if the embedded data is type message, or can
it? (Even if it can, that's a bit esoteric.)

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

There are two problems with yours:  It doesn't allow spaces before the
colon (easily fixed), and it includes trailing space in $MATCH (which is

RFC822 doesn't permit whitespace before the colon, does it? 

why I used formail, I can't spot a way to strip the trailing space but
otherwise capture the entire value without using an external process).

Hokay, how about

    * ^Content-transfer-encoding:[       ]*\/[^         ](.*[^   ])*

This seems to work as intended, grabbing embedded spaces but omitting
any trailing ones. (I only did a quickie test, though.)

/* 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>