procmail
[Top] [All Lists]

Re: Can procmail be used to move mail between folders?

2001-07-31 13:49:48
On Tue, Jul 31, 2001 at 12:59:53PM -0500, Philip Guenther wrote:
Renaming a file doesn't protect it against concurrent access, it just
makes the window smaller.  Processes that open()ed the original file
will continue to access the moved file, possibly appending messages.
The only way to detect when they (there could be more than one!) are
done is to lock the file!  Renaming the file may still be useful to
solve problem #2 (elided above), but it doesn't solve the locking problem.

Ugh. I didn't explain what I meant quite well enough.  What I meant was that
the IMAP process won't suddenly barf because the file it was writting to isn't
there any more. As long as the file is still on the same partition, it will
finish it's write normally. (And if it has moved to another partition, the
file simply won't be deleted from it's original location until IMAP is done,
thus it writes and is immediatly deleted, losing whatever it wrote.) Yes, you
still have the issue of doing a concurrent read of the file while IMAP is
writing to it, so a delay after the move might be in order (though lock
checking would be the "proper" method).

-- 
Every man should know how to make at least one drink from a foreign country,
preferably one taught to him by a local female with whom he has had a
complicated, unresolved, and quite possibly dangerous dalliance.
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail