On Dec 3, 2004, at 7:24 PM, Tom Collins wrote:
I don't know. I've only started to look into the mail quota code.
I may pull fresh code from the most recent Courier-IMAP (original source of most of the code) and make sure that I spend as little time with the file open as necessary. I think that vdelivermail will open it for exclusive write access and then append the new size.
I have no idea how it will behave if multiple processes want to append to it at the same time. It may be difficult, but I guess I could write a shell script that attempts to deliver two very large emails simultaneously. I could also add an artificial delay in vdelivermail so it keeps the file open longer than necessary in order to force one process to wait for write access.
Tom Collins - [EMAIL PROTECTED]
QmailAdmin: http://qmailadmin.sf.net/ Vpopmail: http://vpopmail.sf.net/
Info on the Sniffter hand-held Network Tester: http://sniffter.com/
How about locking the file from reading and writing until the writing task is complete, that way there should never be an inconsistent moment, unless off course two vdelivermails try to grab the file lock at the same time, and kernel both grants them (Happened to me on BSD 4.2, was solved in a later version). So that should never happen.
If you make the time spent with the file as little as possible, then there should be no slowdown at all.