procmail
[Top] [All Lists]

Re: mime-decode.rc

1997-05-29 03:32:00
Roderick Schertler <roderick(_at_)argon(_dot_)org> replied to era:
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
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).

Headers *should not* have spaces before the colon. They cease to become
valid headers then, but if you really want it, it is easily fixed. As
for your trailing space problem, it is my recollection that the content
transfer encoding type cannot itslef have spaces in it, which makes the
task doable with:

* ^Content-transfer-encoding[ ^I]*:[ ^I]*\/[^ ^I]*

It is probably what era meant, anyway, to keey *leading* spaces out of
the match, thanks to procmail's leftmost-shortest matching outside of
captured text. (This, IMHO, should by controlled by a flag, such as case
sensitivity it.)

Elijah
------
Please do not CC me when replying to the list.  It is not my responsibility to
prove to you my mail is not spam, if mail to you bounces it will not be resent.

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