Re: logging Date, From To and CC?

[email protected]
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
 > >>> 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/
 > }

Ahh.  Neato.  Thanks for the info!  

Thanks also to David Tamkin: here's "his way" where the config and the
resulting log entries look really nice...

LOG="`echo ----; formail -X From: -X Date: -X To: -X Cc: | sed 's/^/ /'`
"
NL="
"

## JUNK_MAIL_PATTERN rule/recipe...
:0
* ^Subject: JUNK_MAIL_PATTERN
{
  LOG=" Rule: /^Subject: JUNK_MAIL_PATTERN/ ${NL}"
  :0
  /dev/null
}


steve
--

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
[email protected]
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
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.