procmail
[Top] [All Lists]

Re: Log file interleaving

2006-12-12 17:40:41
Patrick Shanahan schreef:
Ruud H.G. van Tol:

I was talking about a single assignment to LOG. If there are more
  LOG = "blahblah"
occurences, then they can get interleaved by other procmail
processes. That is why I use a $ToLOG that I append to, and only at
   delivery I do LOG = $ToLOG

Please explain this (in layman terms :^) ).  I frequently observe
mixing data in the $LOGFILE.

LOGFILE="$PMDIR/log"
LOGABSTRACT=all

LOG="$NL++++++++++++++$$+++++++++++++++++$NL"


I use a variable to collect everything that I want to log. I called it
ToLOG because that made it easy to change "LOG =" lines to "ToLOG ="
lines.

It looks like this:

   ToLOG = $n   # newline

<recipes>

# parsed From_
   ToLOG = "${ToLOG}~$$${t}From ${From_Addr} (${DDD} ${YYYY}-${MM}-${DD}
${HH}:${NN}:${SS} ${From_TZ})$n"

<recipes>

  :0
  *$ ^Subject:.*\/$S.*
  { H_Subject = $MATCH }
  ToLOG = "$ToLOG $$${t}Subject: $H_Subject$n"

<recipes>

#-----------------------------------------------------------
#       delivery starts here.
#-----------------------------------------------------------

#       This will keep most viral stuff out (of your Inbox).
  INCLUDERC = "$RC_dir/antivirus.rc"

#       This will keep mail from friends in.
  INCLUDERC = "$RC_dir/greenlist.rc"

#       Check X-DNSBL-Warning results.
  INCLUDERC = "$RC_dir/dnsbl.rc"

#       Check X-Spam-Score results.
  INCLUDERC = "$RC_dir/spamtest.rc"

#       This will keep non-RFC-compliant messages out.
  INCLUDERC = "$RC_dir/non-rfc.rc"

#       Deliver mail (sorting list-messages to list-box, etc.)
  INCLUDERC = "$RC_dir/deliver.rc"

#######################################################
#                                                     #
#    If the message is not delivered yet,             #
#    procmail will put it in your standard Inbox.     #
#                                                     #
#######################################################

  LOG = $ToLOG

# end-of-.procmailrc

-- 
Groet, Ruud


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail