procmail
[Top] [All Lists]

procmail log file corruption

2004-08-23 21:27:17
Hello,

Last month I asked this mailing list about a problem I'm having
with my procmail log file getting corrupted.  There weren't any
responses and I'm still having the problem, so I'm trying again.

My .procmailrc handles many, many messages a day for my domain.
The email processing at my ISP is distributed among several
different machines (Red Hat 7.2, procmail 3.21) and the home
and mail directories are NFS mounted.

I log information so I can gather statistics about spam and how
my spam filters are working.  The log entries would get interleaved
and overwritten if I just used LOG to write the entries.  Instead,
I collect all the info and write to the log with a single echo
using TRAP.  I also lock the log file before writing to it. 
Here is my TRAP:

TRAP='abstract=`formail -l $LASTFOLDER`; date=`date`; lockfile -r 8 -l 1024 
$LOGFILE$LOCKEXT; echo "$abstract
  Filter: $filter$test
  Delivered: $date"; rm -f $LOGFILE$LOCKEXT'

(Yes, I prefer to use bare newlines here.)

Here is a typical log entry:

From vefittsdx(_at_)aol(_dot_)com  Mon Aug 23 00:05:19 2004
 Subject: Your illness won't have a chance!
  Folder: /dev/null                                                        1440
  Filter: bad-address
  Delivered: Mon Aug 23 00:05:19 PDT 2004

(Yes, I toss spam into /dev/null, but I also keep a backup copy
of all email at the top of my .procmailrc just in case.)

I don't have any problems with log entries getting interleaved,
but some log entries still overwrite each other.  Shouldn't
lockfile prevent this from happening?

Here is an example where the end of one entry is overwritten by
the beginning of another:

From lqjucsaik(_at_)netvigator(_dot_)com  Mon Aug 23 04:10:35 2004  
 Subject: bullfrog stalactites behind 0295
  Folder: /dev/null                                                       13145
  Filter: bad-address
  Delivered: Mon AuFrom cpoksyshqortzf(_at_)ccnt(_dot_)com  Mon Aug 23 04:10:35 
2004       
 Subject: for 42 and
  Folder: /dev/null                                                       12587
  Filter: bad-address
  Delivered: Mon Aug 23 04:10:35 PDT 2004

Here is another example where an entry gets clobbered:

From optimistelect(_at_)mail2Harold(_dot_)com  Mon Aug 23 04:35:52 2004
 Subject: 85 - JV . . . chokeberry conjure
  Folder: /dev/null                                                        4337
  Filter: bad-address
  Delivered: Mon Aug 23 04:35:52 PDT 2004
ivered: Mon Aug 23 04:35:52 PDT 2004
From Rolandsnmec(_at_)virtualactive(_dot_)com  Mon Aug 23 04:35:52 2004
 Subject: re:tentative interview on the 22th -  Mon, 23 Aug 2004 04:35:32 -0700
  Folder: /dev/null                                                        3298
  Filter: bad-address
  Delivered: Mon Aug 23 04:35:52 PDT 2004

Does anyone have any idea what's going on?  If there was a
problem with lockfile, I would expect to see mailboxes getting
corrupted too but my mailboxes are fine.  I am using the exact
same lockfile timeouts that the procmail source code uses.

I have tried debugging with VERBOSE=yes, but that doesn't help
because the extended diagnostics don't tell me anything useful
and just clobber the log file even more.

Any help is greatly appreciated,
Lloyd Lee-Lim


____________________________________________________________
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

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