procmail
[Top] [All Lists]

Re: Stripping Headers

2002-08-16 04:43:25
Sean suggested,

| >  OLDFROM=|formail -xFrom:
| >
| >  : 0hf
| >  | formail -I "From:" -I "X-FC-Forwarded-From: $OLDFROM"

Ruud read Derek's question the other way and inverted Sean's answer:

| What I read was that DY wants to put the value (of the
| X-FC-Forwarded-From:) in the From: header.
|
|   ORGFROM=|formail -xX-FC-Forwarded-From:
|
|   : 0hf
|   | formail -I "X-FC-Forwarded-From:" -I "From: $ORGFROM"

Oy.

1. VARIABLE=|command  is valid syntax only as the action of a recipe, not out
by itself, where you need VARIABLE=`command`.

2. Each has two calls to formail, when the first one could be done within
procmail by using the MATCH facility.  If Ruud's reading is right,

 :0hf # brackets enclose caret, space, tab
 * ^X-FC-Forwarded-From:.*\/[^     ].*
 | formail -i "From: $MATCH" -I X-FC-Forwarded-From:

If Sean's reading is correct,

 :0hf # brackets enclose caret, space, tab
 * ^From:.*\/[^     ].*
 | formail -i "X-FC-Forwarded-From: $MATCH" -I From:

though that would leave the message with no From: header, so I tend to agree
with Ruud.

3. There's always the more direct and yet more indirect approach:

 :0hf
 * ^X-FC-Forwarded-From:
 | formail -i From: -R X-FC-Forwarded-From: From: -I Old-From:

or if Sean is right,

 :0hf
 | formail -i X-FC-Forwarded-From: -R From: X-FC-Forwarded-From: \
   -I Old-X-FC-Forwarded-From:



_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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