procmail
[Top] [All Lists]

Re: Modifying message, continuing as normal

1997-08-19 13:08:45
Quoting Timothy J Luoma (luomat(_at_)peak(_dot_)org):
:0fhw
* Content-Type:.*enriched/text
| my-strip-enriched-executable

IIRC, the lowercase h will feed the header to the pipe, which is not the
intent. An uppercase H will make the regexp check the header, but will 
feed the whole message to the pipe. Depending on how the stripper
program works (i.e., whether it will screw up header fields) it might be
necessary to do something like (also relabeling the content type):

  :0 H
  * Content-Type:whatever
  {
     :0 fhw
     | formail -I "Content-Type: text/plain"

     :0 fbw
     | stripperprog
  }

I _think_ that will feed the header to formail and the body to the
converter, and I _think_ procmail will put everything back together, but
I'm not certain. (Testing this would be a good idea, and I'd do so if
I had time :) One other thing that occurs to me (yeah, I forgot a lot
with my first email) is that the enriched version has a better than
usual chance of being encoded. If this is going to be a problem for 
the conversion program, and if your sendmail doesn't autoconvert to
8bit, you'll want to put an 8 bit converter higher up in your
procmailrc. If qp isn't going to be a problem, you still might want
to put another condition like "*!content-transfer-encoding:[    ]base64"
in, because your converter will probably do bad things to base64.

-- 
Michael Stone, Sysadmin, ITRI     PGP: key 1024/76556F95 from mit keyserver,
mstone(_at_)itri(_dot_)loyola(_dot_)edu            finger, or email with 
"Subject: get pgp key"