[dovecot] Re: [bincimap] Re: Re: bincimap

Andreas Aardal Hanssen dovecot at andreas.hanssen.name
Mon Feb 17 22:21:44 EET 2003


On 17 Feb 2003, Timo Sirainen wrote:
>On Mon, 2003-02-17 at 21:39, Timo Sirainen wrote:
>> >         /* move the file into new/ directory - syncing will pick it
>> >            up from there */
>> >         if (rename(tmp_path, new_path) == 0)
>> >                 failed = FALSE;
>> > Here you can lose emails if the new/ folder contains a message whose base 
>> > name is equal.
>> In theory, yes. In practice, I'd say not.
>Courier and qmail-pop3d also use rename() instead of link()+unlink().
>I'd say it's safe enough then.

Quoting a well known friend of ours, Mark Crispin - Two wrongs doesn't
make one right.

qmail-pop3d doesn't move messages from tmp/ to new/. It only moves
messages from new/ to cur/. Messages _can_ get lost there, and it seems
like Bernstein accepts this.

If a message is lost in this operation, it basically means that a broken
server/client has moved a message from new to cur earlier, without taking
the one second into consideration.

So where is the bug - qmail-pop3d or Dovecot? I'd say both. First and
foremost the server that placed the original message in cur/ in the first
place, in breach of Maildir, and qmail-pop3d for renaming that message
instead of linking it.

Andy

-- 
Andreas Aardal Hanssen
http://www.andreas.hanssen.name/gpg






More information about the dovecot mailing list