This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: mailbox (Maildir): avoid losing messages on name clash
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: akuchling Nosy List: akuchling, baikie
Priority: high Keywords: patch

Created on 2006-06-29 18:26 by baikie, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
mailbox-maildir-link.diff baikie, 2006-06-29 18:26 Use link()/unlink() and O_EXCL in Maildir delivery
Messages (3)
msg50555 - (view) Author: David Watson (baikie) Date: 2006-06-29 18:26
The Maildir specification says that messages should be
moved into the "new" directory using link()/unlink(),
not rename().  This isn't for compatibility with
ancient Unixes, but to avoid overwriting an existing
message if the "unique" name turns out not to be unique
after all.  (In the current implementation this can
happen if the system clock only has whole-second
resolution and deliveries are being done in
subprocesses, or the clock has been adjusted backwards,
or two machines have the same hostname.)  Similarly,
the file in "tmp" should be created O_EXCL.  This patch
implements these requirements, falling back to rename()
if link() is unavailable (where on Windows at least,
it's supposed to fail if the destination exists), and
raising ExternalClashError when the link/rename fails
due to the name already being taken in "new".
msg50556 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-11-09 21:17
Logged In: YES 
user_id=11375

Applied to the trunk in rev. 52712; will backport to
25-maint after seeing what happens on the buildbots.
msg50557 - (view) Author: A.M. Kuchling (akuchling) * (Python committer) Date: 2006-11-10 13:24
Logged In: YES 
user_id=11375

Applied to 25-maint in rev. 52720.  Thanks for the patch!
History
Date User Action Args
2022-04-11 14:56:18adminsetgithub: 43576
2006-06-29 18:26:11baikiecreate