Re: [imap5] ERASE command as part of MOVE

Timo Sirainen <tss@iki.fi> Sat, 02 June 2012 11:39 UTC

Return-Path: <tss@iki.fi>
X-Original-To: imap5@ietfa.amsl.com
Delivered-To: imap5@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1184321F8A64 for <imap5@ietfa.amsl.com>; Sat, 2 Jun 2012 04:39:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -110.165
X-Spam-Level:
X-Spam-Status: No, score=-110.165 tagged_above=-999 required=5 tests=[AWL=-0.166, BAYES_00=-2.599, J_CHICKENPOX_57=0.6, RCVD_IN_DNSWL_HI=-8, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NdNY0rzTgNK6 for <imap5@ietfa.amsl.com>; Sat, 2 Jun 2012 04:39:17 -0700 (PDT)
Received: from dovecot.org (dovecot.org [193.210.130.67]) by ietfa.amsl.com (Postfix) with ESMTP id 74C7B21F8A5E for <imap5@ietf.org>; Sat, 2 Jun 2012 04:39:11 -0700 (PDT)
Received: from [192.168.10.101] (a88-112-255-76.elisa-laajakaista.fi [88.112.255.76]) by dovecot.org (Postfix) with ESMTP id DC5F21AE876B; Sat, 2 Jun 2012 14:39:09 +0300 (EEST)
Mime-Version: 1.0 (Apple Message framework v1084)
Content-Type: text/plain; charset="us-ascii"
From: Timo Sirainen <tss@iki.fi>
In-Reply-To: <20120602042751.GD2654@launde.brong.net>
Date: Sat, 02 Jun 2012 14:39:09 +0300
Content-Transfer-Encoding: quoted-printable
Message-Id: <96F9DFD9-AF45-40F6-AE19-605B9BAB4D19@iki.fi>
References: <20120601222311.GB598@launde.brong.net> <41D94689-2BBA-4E74-B6AE-CD6C75918A11@iki.fi> <20120602042751.GD2654@launde.brong.net>
To: Bron Gondwana <brong@fastmail.fm>
X-Mailer: Apple Mail (2.1084)
Cc: "imap5@ietf.org slimming-down IMAP." <imap5@ietf.org>
Subject: Re: [imap5] ERASE command as part of MOVE
X-BeenThere: imap5@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "Discussion on drastically slimming-down IMAP." <imap5.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/imap5>, <mailto:imap5-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/imap5>
List-Post: <mailto:imap5@ietf.org>
List-Help: <mailto:imap5-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/imap5>, <mailto:imap5-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 02 Jun 2012 11:39:18 -0000

On 2.6.2012, at 7.27, Bron Gondwana wrote:

>> It doesn't need to be an extra roundtrip. You can run uidexpunge even if store fails and it doesn't do anything bad. By avoiding the extra roundtrip it is possible for the server to optimize the STORE+EXPUNGE into equivalent of ERASE. (Dovecot does halfway that - it for example doesn't rename maildir files on STORE stage, just unlinks them on EXPUNGE.)
> 
> Not so easy if you want to delete the messages by sequence number of
> course.
> 
> TAG ERASE 1:10
> 
> Isn't implementable as a pipelined command, it would have to be
> 
> TAG1 STORE 1:10 +Flags \Deleted
> TAG2 UID EXPUNGE UID1,UID2,UID3,UID4,UID5..UID10

It can still be pipelined. You would of course need to know the UIDs.

> So how does Dovecot handle a crash or filesystem error during that
> intermediate stage?  Replay an action log?  

Yes.

> What if the file can't
> be renamed, but it's already replied to a client saying "yes, your
> flag store succeeded"?

The message gets marked as having "dirty flags" meaning the flags in index file should be used instead of the flags in maildir file.