Klaus Johannes Rusch:
Ruud H.G. van Tol:
/usr/bin/perl5 -n -p -e 's/^Message-Id: (.*)$/Message-Id: <$1>/'
Aaargh, please learn formail.
You did see the disclaimer that a Perl solution was overkill for this,
You did see my please. Disclaimers are bad too. If one needs to
go from A to B and does not mind visiting every other imaginable
(or not even that) location, then one could just start walking.
I feel strongly that suggesting perl (or sed) to simply change a
header (as is the current context), should be discouraged on the
procmail-list. Because procmail and formail are what this list
Even a disclaimer such as '(untested)' (without giving a reason)
is never nice. A tested version:
:0 fhw # beware: allows an empty <>
* ! ^Message-Id:.*<.*>
* ^Message-Id:.*\/[^ ]+
| formail -i "Message-Id: <$MATCH>"
(I found out that the < and > should not be escaped.)
This will present the value of the original 'Message-Id' field
in an Old-Message-Id: header (see -i in man formail).
I chose -i because I prefer such traceable changes.
procmail mailing list Procmail homepage: http://www.procmail.org/