D. J. Bernstein writes:

Sam Varshavchik writes:
This breaks Courier and Qmail.
No. qmail's maildir_scan() looks only at files with mtime < time, so it
Nowhere do I find this in "HOW A MESSAGE IS READ" in maildir(5).

can't move anything out of the delivery directory until the next second.
Duplicates are eliminated by the standard use of stat() in delivery.
"HOW A MESSAGE IS DELIVERED" refers to stat()ing the tmp directory only. link() will catch it, provided that the reader does indeed ignore mail in new that's timestamp now or in the future.

The problem is besides qmail-pop3d nobody's doing that. I don't see why they would. This is mentioned nowhere in maildir(5). Does mutt ignore stuff in new that's timestamp with now, or in the future? I'll bet that it doesn't. Unless mutt also ignores new mail timestamp now or future, using mutt with Qmail might expose this race. mutt moves mail from new to cur just after it gets linked to new. Another qmail-local is forked, and it gets the same pid as the one that just died.

I'm going to have to tell people that they'll have to use the modified deliverquota (that inserts microseconds), with Qmail if they're going to read mail with Courier-IMAP. Having Qmail deliver mail to new directly will expose the race.

Reply via email to