procmail
[Top] [All Lists]

Re: third part of message ?

2002-06-10 10:29:04
Marek Wysmulek <marek(_dot_)wysmulek(_at_)hermes-kredit(_dot_)pl> wrote:
This is a multi-part message in MIME format.
----------------
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mr3.ipartners.pl
id g5AAaAL23244

OK. I know what it is (part of mime code of message - or I think so). One
thing is sure for me it is not the part of
the header nor body so how to filter it out ?

A mail message has exactly one header and exactly one body. That's all
there is to it.

How did you come to the conclusion that this MIME part wasn't part of the
header or body of the e-mail? I'd like to understand that, because maybe
there's some better way to explain how mail works which will prevent others
from following that particular well-trodden path to nowhere. (Maybe you
yourself could make a web page explaining it?)


Multipurpose Internet Mail Extensions (MIME) is an extension to the regular
standard for mail which allows for the inclusion of mutiple parts within
the same e-mail body, and also allows for encodings of those parts.

Procmail by itself doesn't know anything about MIME.


You can identify certain MIME-related headers, and mangle/rewrite in place,
without regard to the MIME structure (various). You can try to "understand"
the MIME structure and mangle/rewrite within that context (PerlJacket)
without fundamentally restructuring the mail. Or you can actually
"deconstruct" the MIMEd message into its component parts, deal with them as
you see fit, and reconstitute a "new and improved" message (for instance
with CPAN MIME::).

Very briefly: after the MIME boundary, all lines are (part) headers until a
blank line... same as with the e-mail as a whole.

Now I have some bad news for you: since the part header you're quoting is
encoded in quoted-printable, "some action on body" which assumes that what
it's seeing is "human readable" text may not work... quoted-printable is
designed to be mostly readable, but that is at the discretion of the
encoder, and for instance a spammer or somebody engaged in craft may decide
they don't particularly want at least certain parts to be "readable":
precisely so that it will circumvent whatever you're trying to do with your
procmail recipe. (Note to spammers: you must learn to use base-64 for your
text parts to evade all filtering. Yeah, that's the ticket!).


Make no mistake though, that MIME part is indeed part of the message body.
All of this is meticulously documented in numerous RFCs:

  http://www.inwa.net/~m3047/procmail/rfc-tree.pdf


It's a lot more productive to be able to say to somebody "sure, here's
how". But if somebody says to you "it's so hard to calculate the orbits of
the celestial spheres, their paths around the earth seem so complicated and
yet driven by a grand design.." what can you say except "uhhh buddy, it
works a lot better if you get beyond the notion that everything revolves
around the earth"?

--

Fred Morris
m3047(_at_)inwa(_dot_)net


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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