in reply to You've got mail!

Suppose the following scenario:I think it is called a race condition.

One other remark: would it be easier on the computer resources to have daemon run by a cron-type job rather than keep it running and sleeping? Probably depend on how quickly it has to run again.

One final comment: some ISP's don't like it that their mail-servers get polled at a too high rate (several times every few minutes). I once got cut-off for 10 minutes by just doing that.

CountZero

"If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law