Re: [imap5] ERASE command as part of MOVE

Bron Gondwana <brong@fastmail.fm> Sat, 02 June 2012 04:27 UTC

Return-Path: <brong@fastmail.fm>
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 0911A11E80C6 for <imap5@ietfa.amsl.com>; Fri, 1 Jun 2012 21:27:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.205
X-Spam-Level:
X-Spam-Status: No, score=-3.205 tagged_above=-999 required=5 tests=[AWL=-0.206, BAYES_00=-2.599, J_CHICKENPOX_57=0.6, RCVD_IN_DNSWL_LOW=-1]
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 v+lZigoQcRut for <imap5@ietfa.amsl.com>; Fri, 1 Jun 2012 21:27:51 -0700 (PDT)
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by ietfa.amsl.com (Postfix) with ESMTP id A347911E8096 for <imap5@ietf.org>; Fri, 1 Jun 2012 21:27:51 -0700 (PDT)
Received: from compute4.internal (compute4.nyi.mail.srv.osa [10.202.2.44]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 5287C21288; Sat, 2 Jun 2012 00:27:51 -0400 (EDT)
Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute4.internal (MEProxy); Sat, 02 Jun 2012 00:27:51 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=mesmtp; bh=YQEFrf94IlwIZJiOSPFWiGw8 7HM=; b=DZZvWdB8nItlfY4YsCIbTiJgIvgyhf1k110swHmysgu58T091UaOpNz2 dg3pU4dPlyEhL7k8p4L65pxWfSpRnX6/oTVLCa+zBfzL5jLxrK/VgcNDevlZ3SKE BdOukl6sWyRgqtRbetbr+ZftNXeAXEqFHlj25LmEdjBOqOwYkPk=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :references:mime-version:content-type:in-reply-to; s=smtpout; bh=YQEFrf94IlwIZJiOSPFWiGw87HM=; b=cEZ0DHtqeSEo2wZ9OrY/O1mDVF8D 7Ar51bVgQdi9Hy2GC9r5NifA2wT7tJTnuCqokhXN5NVDOVfvLWS8+F+QKIlHrLrz U8iBZMA9wS5rPF4hUMoBUjoosX49fmIbs0dz2ZGj4Awd94w9RNQFVv3bB7R4bHgN z7G3ZT40K37S1R0=
X-Sasl-enc: oUeQcWbEx6eoIOfHIFYfvP0ttHUVivpJqORw1O7tK6fJ 1338611271
Received: from localhost (unknown [31.45.20.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 0ABC58E01FC; Sat, 2 Jun 2012 00:27:51 -0400 (EDT)
Received: by localhost (Postfix, from userid 1000) id 89A7F7E00BD; Sat, 2 Jun 2012 06:27:51 +0200 (CEST)
Date: Sat, 02 Jun 2012 06:27:51 +0200
From: Bron Gondwana <brong@fastmail.fm>
To: Timo Sirainen <tss@iki.fi>
Message-ID: <20120602042751.GD2654@launde.brong.net>
References: <20120601222311.GB598@launde.brong.net> <41D94689-2BBA-4E74-B6AE-CD6C75918A11@iki.fi>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <41D94689-2BBA-4E74-B6AE-CD6C75918A11@iki.fi>
Organization: brong.net
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Arnt Gulbrandsen <arnt@gulbrandsen.priv.no>, 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 04:27:53 -0000

On Sat, Jun 02, 2012 at 01:27:58AM +0300, Timo Sirainen wrote:
> On 2.6.2012, at 1.23, Bron Gondwana wrote:
> 
> > This probably shits the purists as much as anything else.
> > But I can tell you for sure that the FastMail web interface
> > does its "Delete Permanently" as: 
> > 
> >    $Res = $Self->store($Uids, "+flags", "(\\seen \\deleted)")
> >         && $Self->uidexpunge($Uids)
> >         && $Self->refresh_count('');
> > 
> > Which is an extra roundtrip to the server and an extra lock and
> > parse of the mailbox index.
> 
> 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

So how does Dovecot handle a crash or filesystem error during that
intermediate stage?  Replay an action log?  What if the file can't
be renamed, but it's already replied to a client saying "yes, your
flag store succeeded"?

Bron.