MBOX-Line: From tss at iki.fi  Fri Jun 11 06:27:18 2010
To: imap-protocol@u.washington.edu
From: Timo Sirainen <tss@iki.fi>
Date: Fri Jun  8 12:34:43 2018
Subject: [Imap-protocol] IMAP MOVE extension
In-Reply-To: <201006111454.51874.witold.krecicki@firma.o2.pl>
References: <201006110854.37969.witold.krecicki@firma.o2.pl>
	<201006111437.03613.witold.krecicki@firma.o2.pl>
	<D159C4D6-24D9-4BF8-98EF-E5E1EC26028C@iki.fi>
	<201006111454.51874.witold.krecicki@firma.o2.pl>
Message-ID: <1276262838.22134.61.camel@kurkku.sapo.corppt.com>

On pe, 2010-06-11 at 14:54 +0200, Witold Kr?cicki wrote:
> On Friday 11 of June 2010 14:44:43 Timo Sirainen wrote:
> > On 11.6.2010, at 13.37, Witold Kr?cicki wrote:
> > >> I once thought about implementing MOVE operation to Dovecot to improve
> > >> speed. But then I realized that if client sends STORE \Deleted and
> > >> EXPUNGE in same IP packet, I can just optimize away the rename()s
> > >> caused by STORE. The remaining link()+unlink() should then be about as
> > >> fast as rename(). The only exception is OSX with HFS filesystem, where
> > >> hard links are really inefficient.
> > > 
> > > And how hard it would be to really implement it in Dovecot?
> > 
> > Much more difficult than I originally thought.
> Well, 'brutal' (and nonsense in a way) implementation would be to 'internally' 
> do copy messages listed and then expunge messages that were copied (at least 
> there is no setting flags). 

The problem is that I'd have to add a new internal "move" operation, and
then quota code would also have to handle it, and there are probably
many other places that would need to handle it. Also the whole move
operation doesn't really even fit into Dovecot's internal design. It
would be difficult to implement in any other way than copy+expunge (but
with all the extra complexity in quota/etc code).

> I thought on including the statement that if it would take more time to do 
> 'move' than to do cp/st/ex routine the server SHOULD NOT provide MOVE 
> extension.

Then there's the problem that servers can support multiple mailbox
formats. Possibly even the same user's mailboxes can be in different
formats. While MOVE might help with maildir, it wouldn't help with mbox.


