Hi, I have a big mail archive in which the From... top header has disappeared and has been replaced by an empty newline. I know it is above the first Received: header so I can locate it.
The mail headers start like this: Received: from smtpout.mac.com ([204.179.120.85]) by lists.apple.com (8.11.6/8.11.6) with ESMTP id fB6BBGb27756 for <[EMAIL PROTECTED]>; Thu, 6 Dec 2001 03:11:16 -0800 (PST) Received: from smtp-relay02.mac.com (server-source-si02 [10.13.10.6]) by smtpout.mac.com (8.12.1/8.10.2/1.0) with ESMTP id fB6B59Jl026926 for <[EMAIL PROTECTED]>; Thu, 6 Dec 2001 03:05:09 -0800 (PST) etc... Usually, it should start like the following (notice the From line): >From [EMAIL PROTECTED] Thu Dec 6 03:11:16 2001 Received: from smtpout.mac.com ([204.179.120.85]) by lists.apple.com (8.11.6/8.11.6) with ESMTP id fB6BBGb27756 for <[EMAIL PROTECTED]>; Thu, 6 Dec 2001 03:11:16 -0800 (PST) Received: from smtp-relay02.mac.com (server-source-si02 [10.13.10.6]) by smtpout.mac.com (8.12.1/8.10.2/1.0) with ESMTP id fB6B59Jl026926 for <[EMAIL PROTECTED]>; Thu, 6 Dec 2001 03:05:09 -0800 (PST) etc... Perl seems the way to go to add the From line. Unfortunately, I have tried many times with no success. I can easily change the "Received:" header to be "From [EMAIL PROTECTED]:" but as there are more than one "Received:" header, they all get replaced, which is bad. I think I need a regex that would match "\n\nReceived:" and replace it with "\nFrom xxxxxx\nReceived:". It doesn't seem difficult but I am stuck. I hope someone can help me, I have tried to solve this for hours... TIA, Bertrand Mansion Mamasam -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>