procmail
[Top] [All Lists]

Re: flow control in /etc/procmailrc

1998-02-14 11:21:48
On Fri, 13 Feb 1998 10:34:07 -0700 (MST), Sherwood Botsford
<sherwood(_at_)math(_dot_)ualberta(_dot_)ca> wrote:
At this point I have no intention of decoding the attachments.
What I want to do is for Mime (and also uuencode) messages is
to not run certain other filters.  E.g. my shout filter looks
for lines that are all in upper case.  A mime file of a doc that
has a large block of whitespace can have large blocks of solid
A's.

Apparently you are talking about messages with base64-encoded
attachments. This is something wildly different from "MIME messages"
you were talking about earlier. The way to catch a message with base64
in it is

    * ^Content-transfer-encoding:\<*base64

However, this is only sufficient for catching messages with a single
body part. MIME allows a message to have several body parts, or
"submessages", in it. (This can even be recursive, and a submessage
can be of the type message/rfc822, for example. At this point, I think
you can appreciate the fact that parsing this in Procmail alone is not
going to be trivial.)
  A reasonable heuristic for catching messages which contain one or
more base64-encoded body parts would be something like

    * ^Content-type:\<*multipart
    * B ?? ^Content-transfer-encoding:\<*base64

This is of course a gross oversimplification but you should find that
mismatches are relatively rare. 

Again, I think it's important to point out that a large part of the
MIME "processing" going on out there is by programs made by people who
didn't have even the vaguest idea how MIME works (it's not too
complicated, if you sit down and look at it, but it's rather clear
that many people didn't).

/* era */

(And unfortunately, I think the MIME FAQ is rather unclear and way too
big. The MIME spec itself is worth a read, though.)

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>

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