[This is the third of the five posts I'm resubmitting. Philip has posted an
answer in the meantime, so parts of this one are redundant now.]
Harry asked,
| For example:
| If I have a rule that says
|
| |formail -R Message-ID: X-Message-ID:
|
| And a message comes thru with Message-Id: (note the lower case d),
| will this rule miss it?
No. Case does not matter in field names, and formail knows that. That
formail command will rename Message-Id: to X-Message-ID:.
| Is the first argument after -R from a known
| set that formail uses or does it scan the headers looking for what
| ever is the content of that argument?
It can be pretty much anything that a field name can consist of or start
with, with a special allowance for 'From '.
| Can the first arg be a regex like: -R Message-[Ii][Dd]:
Regexps are not recognized there; they'll be taken as static text. Since
brackets are not legal in field names, that particular regexp will not be
acceptable. It's also unnecessary.
| What does this mean?
| NOTES
| When renaming, removing, or extracting fields, partial
| fieldnames may be used to specify all fields that start
| with the specified value.
| Is this just a convoluted and guaranteed to confuse way of saying that
| `formail -R Z X-Zappo:' will find all headers starting with Z and
| replace them with X-Zappo.
It says that and lots more. You can also use
formail -R Z X-Zappo # note no colon on X-Zappo
to change all fieldnames beginning with Z to X-Zappo plus whatever was after
the Z (Zippy: becomes X-Zappoippy:, Zlurp: becomes X-Zappolurp:, and so
fortrh). Such truncating will also work with the -i, -I, -x, and -X
options. For example, with formail -i re every Received: or Reply-To: or
Return-Path: or Resent-anything will get an Old- in front of it, but the
Ram-It-Up-Yours: and Rhonda-I-Love-You: fields will not be changed. (Aren't
you glad, Timothy, that have the net, a place where your profession doesn't
deter anyone from using language like "ram it up yours"?)
In fact, when I'm filtering mail through formail anyway, and later I'm going
to have a sed filter for the subject line, in order not to need to tell sed
to look for /^[Ss][Uu][Bb][Jj][Ee][Cc][Tt]:/ I just throw -R Subject:
Subject: onto formail's command line, and then I know that any subject
fields will be named exactly "Subject:" and not "SUbjEcT:" or any other
casing.
| Could I solve the above problem by saying:
| formail -R Message X-Save-Msgid:
I would advise against that, as it would also rename all other fields whose
names start with "Message" to X-Save-Msgid:. There rarely will be any, but
you never know when there might be.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail