On Mon, 2003-02-17 at 23:31, Andreas Aardal Hanssen wrote:
Do you have URL or something? I didn't find it.
Starts here:
http://marc.theaimsgroup.com/?l=qmail&m=104250383122015&w=2
Sam of Courier-IMAP claimed that OpenBSD's random pid assignment broke qmail and Courier-IMAP. It certainly broke Courier-IMAP.
Well, that helped some, except most of the suggested "fixes" didn't really help.
I can think of one clean solution for this: Make sure the base filename is unique by using inode and/or making sure that process trying to APPEND has existed at least for a second and will exist for at least the next second.
That still doesn't help if someone else screwed up and created multiple identical base names, but I'd really rather not use link+unlink. I think I will anyway make my maildir_sync() to check for basename conflicts and fix them.
Moving from new/ to cur/ or renaming within cur/ is more tricky though. MUAs could see both of the mails at the same time which could lead to weird problems.
Yes - if both mails are present, the client needs to 1) do something smart or 2) ignore the problem and let the sysadmin do something smart.
I don't mean that as any failure condition. That could happen in everyday mail usage if there's multiple clients accessing the same mailbox. One client scanning the maildir at the same time as another client is updating mail flag. The same mail could show up twice with readdir() even if the other one is soon after unlink()ed.