procmail
[Top] [All Lists]

Re: Procmail and perl revisited

1999-05-06 06:47:12
On Thu, 6 May 1999 14:30:52 +0200 (MET DST), Holger Wahlen
<H(_dot_)Wahlen(_at_)fz-juelich(_dot_)de> wrote:
era wrote:
<dhill(_at_)sunbeach(_dot_)net> wrote:
However, I have just realised that if I get 2 mails in the same
second, I'm up a creek.  Can anyone suggest a better method of what
Pipes solve that too. Otherwise, you'd have to use a local lock file.
A lock file might still be a good idea, though, to deal with the
script output: if two messages arrive shortly after each other,
the script processes that are started might interfere with each
other when writing to the log file. (Or is there no danger
because each copy only writes one line?) 

To me, that sounds overcautious. This depends, of course, on what the
script produces, but in this case, if I understood Duncan correctly,
there might at most be an error message or two written to standard
error. These should perhaps include a PID or something to distinguish
two processes running at the same time, if they are likely to produce
more than perhaps an occasional one-liner. 

And anyway, the integrity of the log file can't be guaranteed anyhow.
Procmail never locks the log file while writing to it. If you have
accumulated log files over time, you will perhaps find entries which
have crashed into each other, like this:

 From nobody(_at_)dmoz(_dot_)org  Tue Apr 27 18:39:00 1999
 From owner-spam-l(_at_)PEACH(_dot_)EASE(_dot_)LSOFT(_dot_)COM  Tue Apr 27 
19:43:13 1999
  Subject:      Re: ABUSE-RE: Virtualis just doesn't get it (No Techno Babble)
   Folder: inbox/spam-l                                                    2782
  Subject: ODP Feedback
   Folder: inbox/junk                                                      1575

I believe the log abstract usually gets written in a single write
(unconfirmed, but it would seem to make sense) so this is somewhat
unlikely to happen, but if your own scripts do their own logging with
LOG= every now and then, you will be sure to see mangled entries like
this.

/* era */

-- 
.obBotBait: It shouldn't even matter whether     <http://www.iki.fi/era/>
I am a resident of the state of Washington. <http://members.xoom.com/procmail/>
 * Sign the European spam petition! <http://www.politik-digital.de/spam/en/> *

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