locking w/ whitelisting

David Relson relson at osagesoftware.com
Wed Mar 26 02:47:34 CET 2003


At 07:57 PM 3/25/03, Barry Gould wrote:

>Hi,
>
>In my procmailrc, I have a whitelist, which does makes a copy, and runs it 
>through bogofilter -n
>(recipe below)
>
>Subsequently, all messages are run through bogofilter -e -p
>
>I'm concerned that the whitelist may not work on the current message if 
>both tasks run at the same time; i.e. the -e -p may not be affected by the 
>-n for the current message.
>
>Question: should I do some sort of locking so that the bogofilter -n 
>finishes before the bogofilter -e -p? What would be the best way to 
>achieve this?
>
>Thanks,
>Barry

Barry,

Let me see if I under the scenario that you're worrying about.  A whitelist 
message arrives, which causes bogofilter to update its non-spam 
wordlist.  While this is happening, a second (non-whitelist) message 
arrives.  You're wondering whether there will be problems with two copies 
of bogofilter running.  Is this your scenario?

Bogofilter locks the wordlists to prevent corruption.  If bogofilter finds 
a wordlist already locked, it delays a while and tries again.  (The code 
for this is in file src/wordlists.c, functions open_wordlists() and 
rand_sleep()).

With this lock/retry code you should be safe.

David





More information about the Bogofilter mailing list