procmail
[Top] [All Lists]

Re: MIME parts and Procmail

1998-05-12 12:03:30
Edward Marshall wrote,

| Has anyone considered adding MIME awareness to procmail? I'd say at least
| 80% of the mail I deal with on a daily basis at least has some notion of
| MIME somewhere, even if it's as simple as the Content-Type: being
| text/plain.
| 
| Much of it, however, has multiple pieces, and it would be nice to have
| some automated means of leveraging the code in procmail to handling
| filtering and such against individual portions of a MIME'd message, based
| on the content type or transfer encoding (in the case of transfer
| encoding, automatic decoding would be cool; and doing the same with
| certain content types would be very handy, such as HTML).

Maybe all we need is something to divide a multipart MIME message into its
parts, each of which can then be fed to procmail, either with a different
rcfile or, with some loop prevention, back into the same rcfile.  It might
be enough to extract From:, Subject:, and Date: from the outer header and then

| formail -a "From: $FROM" -a "Subject: $SUBJECT" -a "Date: $DATE" \
  +1des procmail

and the absence of "Content-Type:.*multipart" on the component pieces would
take care of loop detection.

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