procmail
[Top] [All Lists]

Is it possible to both add and delete headers in a single call to formail?

1997-07-05 12:09:00

Actually, I'd like to use a single call to formail to do all of the following:

        1) Delete all the other headers except From: and Subject:
        2) Split an execute a program on each email.
        3) Add a custom header

I can get 1 and 2 by doing:

        formail -k -XFrom: -XSubject: -s someprogram < somefile

But whenever I try to add a -a/-A/-i/-I to the mix, it just gets ignored.
Is there any reason why the following should not work?

        formail -A"X-Foo-Bar: This is the foobar header" -k -XFrom: -XSubject: 
-s someprogram < somefile

Does the placement of the -A and or the -k matter?  I've tried several
different orders/uses of -A/-a/-I/-i and none worked (by not worked, I mean,
the header was not inserted; the rest of the command continued to function
as expected).

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