procmail
[Top] [All Lists]

Re: Extracting headers...

1998-09-29 23:04:28
On Wed, 30 Sep 1998 01:09:36 -0400, Walter Dnes
<waltdnes(_at_)interlog(_dot_)com> wrote:
Humberto Calvani wrote:
Is there a way in procmail to extract certain headers
(eg. Return Path:, Content Type: etc..) from a mail
message while keep the body of the message intact ?
  It's repetitive and ugly, but it can be done.
<...>
LOGFILE=LOGS
D="Date: //ABSENT//"
:0
* ()\/^Date:.*
{ D=$MATCH }
F="From: //ABSENT//"
:0
* ()\/^From:.*
{ F=$MATCH }
<...>
LOG="
#####Message Separator#####
$D
$F
$M
$CT
$A
$CL
"

What's wrong with LOG=`formail -XDate: -XFrom: -XMessage-Id: -etc`?

Or even, in this case, since as far as I can tell, you were only
fiddling with the log just in order to write to an external file,

    :0ch:
    | formail -XDate: -XFrom: -XMessage-Id: -etc >>somefile

Hope this helps,

/* era */

-- 
Bot Bait: It shouldn't even matter whether  (`')  Just  (`')  http://www.iki
I am a resident of the State of Washington   \/ Married! \/   .fi/~era/

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