[imap5] ERASE command as part of MOVE

Bron Gondwana <brong@fastmail.fm> Fri, 01 June 2012 22:23 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 8DFF111E809A for <imap5@ietfa.amsl.com>; Fri, 1 Jun 2012 15:23:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.399
X-Spam-Level:
X-Spam-Status: No, score=-3.399 tagged_above=-999 required=5 tests=[AWL=0.200, BAYES_00=-2.599, 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 tQ7HDFTuat4z for <imap5@ietfa.amsl.com>; Fri, 1 Jun 2012 15:23:12 -0700 (PDT)
Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by ietfa.amsl.com (Postfix) with ESMTP id E966E11E8097 for <imap5@ietf.org>; Fri, 1 Jun 2012 15:23:11 -0700 (PDT)
Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 9D52120F61; Fri, 1 Jun 2012 18:23:11 -0400 (EDT)
Received: from frontend1.nyi.mail.srv.osa ([10.202.2.160]) by compute5.internal (MEProxy); Fri, 01 Jun 2012 18:23:11 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= date:from:to:cc:subject:message-id:mime-version:content-type; s= mesmtp; bh=QINoGN1LZOu/Ndfa2VvWDK8BLao=; b=lQxjdZKCMznbTnHEdqcyB Q4ZV/NhfHdEpmefGIMuw9s+Dg5QkgVDHvoHPSHHFLuEPk5oAz+4yx/F56cvLEKiH L8u5B0J6gdt4iGsVcYm4vJOXNJsLZlmBeXAT9aJquTJgfJyYBndVimF/EHdiSwU6 ao2lLEOOhz9rf0vk0NTk8c=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=date:from:to:cc:subject:message-id :mime-version:content-type; s=smtpout; bh=QINoGN1LZOu/Ndfa2VvWDK 8BLao=; b=b5iXBRni33g81mPNvSJ5//rRLBBm9UvI0QURFK3vYr7j02snADI+ZV 1RNeQh0q40RrSw0M5SWmOHqduI3E+TbVy9yl6B1A5GhElbxYZ23bqQnegfyQKCeK NoSk9VKP4Tz9cZt1VA1mJ5I1BfmiLRF2BOaUVtY4Up9ZC3Uw2pCq8=
X-Sasl-enc: WPUMkK2Po6wm/CrMv17Wg9HI5mmusOnwrSY84kPo8rnO 1338589391
Received: from localhost (unknown [31.45.20.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 570748E020C; Fri, 1 Jun 2012 18:23:11 -0400 (EDT)
Received: by localhost (Postfix, from userid 1000) id 9980D7E00BC; Sat, 2 Jun 2012 00:23:11 +0200 (CEST)
Date: Sat, 02 Jun 2012 00:23:11 +0200
From: Bron Gondwana <brong@fastmail.fm>
To: imap5@ietf.org
Message-ID: <20120601222311.GB598@launde.brong.net>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
Organization: brong.net
User-Agent: Mutt/1.5.21 (2010-09-15)
Cc: Arnt Gulbrandsen <arnt@gulbrandsen.priv.no>
Subject: [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: Fri, 01 Jun 2012 22:23:12 -0000

While looking over Cyrus's excellent review of the MOVE
draft it struck me that MOVE actually has another command
hidden inside its definition.

MOVE is defined as COPY + STORE + "UID EXPUNGE".

But it would be very useful to have the second half of that
available as a separate command in its own right, "ERASE"
(I would say DELETE, but that's already stolen by a different
namespace)

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.  If this was implemented as:

    $Res = $Self->erase($Uids)
         && $Self->refresh_count('');

It would make everything more efficient.  And we wouldn't have to
touch the \Seen flag just in case the intermediate step failed.

So Arnt, does it make sense to either propose both commands as
part of this draft and implement one in terms of the other, or
to do an ERASE first and then a separate MOVE referencing ERASE?

Bron.