Re: logging Date, From To and CC?

LuKreme <[email protected]>
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
On 14 Sep 2012, at 06:48 , [email protected] wrote:
>>> Does anyone have a recipe (patch?) for logging Date From To and CC
>>> when LOGABSTRACT is set??
> 
>> NL="
>> "
>> 
>> :0 H
>> * ^Date:\/.*
>> { HDR_DATE=${MATCH} }
>> :0 H
>> * ^From:\/.*
>> { HDR_FROM=${MATCH} }
>> :0 H
>> * ^To:\/.*
>> { HDR_TO=${MATCH} }
>> :0 H
>> * ^Cc:\/.*
>> { HDR_CC=${MATCH} }
>> 
>> :0  # delivering recipe
>> { LOG="** Date:${HDR_DATE} ${NL}"
>>  LOG="** From:${HDR_FROM} ${NL}"
>>  LOG="** To:${HDR_TO} ${NL}"
>>  LOG="** Cc:${HDR_CC} ${NL}"
>>  :0 :
>>  /delivery/mailbox
>> }
> 
> Hum.  That makes me wonder: how does one log the matching rule??

I would do something like this:

# After { HDR_CC=${MATCH} } line

LOGIT="** Date:${HDR_DATE} ${NL}** From:${HDR_FROM} ${NL}** To:${HDR_TO} ${NL}** Cc:${HDR_CC} ${NL}”

:0 #delivery recipe
{
  LOG="${LOGIT}** Recipe FOO delivered this message ${NL}”
  :0
  .mboxname/
}

[...]

:0 #other delivery recipe
{
  LOG="${LOGIT}** Recipe BAR delivered this message ${NL}”
  :0
  .mboxname/
}


-- 
"Queen Isabella and King Ferdinand kicked 200,000 Jews out of Spain, one
of the first acts of the Spanish Inquisition, which no one ever expects”
-- John Carroll's 21st Annual Xmas Quiz answers
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.