Subject: Re: formail wildcards

From: [email-masked] (Stephen R. van den Berg)
Date: Mon, 18 Jul 1994 14:30:58 +0200

David W. Tamkin <[email-masked]> wrote:
>But here's one question: can one remove all headers whose field names match
>a pattern except for one?

>In my particular case, I'd like to remove all X- headers except X-Mailer:.
>Can that be done without running formail twice?  This doesn't work:

> :f
> * conditions
> | formail -i X-Mailer: -I X- -R Old-X-Mailer: X-Mailer:

>It seems all the -I's are done first regardless of the options' order on
>the command line.  If I add "-X X-Mailer:" all the other header lines will
>disappear, so I haven't tried it.

Right.  The order of the options on the command line is almost irrelevant.
And, no, I don't think this can be done without running formail twice.

>  :
>  * ^X-Mailer: .
>  {

>   :0fh
>   | formail -I X- -A "X-Mailer: $XMAILER"
>  }
>   :Efh  # an E here refers back to a mismatch on "^X-Mailer: .", right?
>   | formail -I X-

Right.

-- 
Sincerely,                                  [email-masked]
           Stephen R. van den Berg (AKA BuGless).

"I have a *cunning* plan!"