procmail
[Top] [All Lists]

Re: missing entry in logfile

1997-06-16 13:29:00
Robert Klemme wrote,

| I have two delivering recipes that react on some common conditions.  The
| first one is a forwarding one and makes a copy (flag 'c') and the second
| one delivers to a file.  I only get a logfile message of the second
| recipe.  Is that normal?  I imagine it could depend on the procmail
| handling the logfile: At the moment of fork() both share the same file
| descriptor and so one output is overwritten by the other one.  Correct?

No, sharing the file descriptor is not the problem.  With procmail 3.11pre7,
Stephen sought to stop logging of variable capture and filtering recipes, and
it went too far.  Now, even if LOGABSTRACT=all, a piping or forwarding recipe
with a "c" flag does not get a logabstract: only saves to folders and final
deliveries do.

You can get around it by spawning a clone and letting it do the logging.  For
example,

   :0c
   * conditions
   ! forwarding args
    :0ac
    { LASTFOLDER="$SENDMAIL $SENDMAILFLAGS forwarding args" TRAP HOST }

and that kludge works, though it means forking an extra procmail.  A cleaner
way, also using a clone, is this:

  :0c
  * conditions
  {
   TRAP # if needed to prevent the clone from executing the TRAP

   :0
   ! forwarding args
  }

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