On Sat, Sep 13, 2008 at 11:26:29PM +1000, Erik Christiansen wrote: > # Avoid logging clashes. Separate log > records. > MAILDIR=/home/erik/mail # Thanks to Bart Schaefer & Ruud H.G. van > Tol: > LOGFILE=$MAILDIR/tmp_log.$$ # <- Each process uses a temporary log. > FINAL_LOG=$MAILDIR/log # <- Append here, via TRAP, at process exit: > TRAP='procmail -p DEFAULT=$FINAL_LOG /dev/null < $LOGFILE && rm -f $LOGFILE' >
Off-topic, but an easier way to log everything to one file which leaves your TRAP variable free for other purposes is to use a global lockfile so only 1 procmail can run at a time: # Global lockfile LOCKFILE=$PMDIR/globallock Theoretically this could impact performance but I can't imagine anyone receiving enough mail to make this an actual problem on any modern machine. Vincent van Leeuwen Media Design - http://www.mediadesign.nl/