Re: [imap5] ERASE command as part of MOVE

Timo Sirainen <tss@iki.fi> Fri, 01 June 2012 22:28 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 3358711E810C for <imap5@ietfa.amsl.com>; Fri, 1 Jun 2012 15:28:00 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -110.151
X-Spam-Level:
X-Spam-Status: No, score=-110.151 tagged_above=-999 required=5 tests=[AWL=-0.152, 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 kcRNScMfvkJV for <imap5@ietfa.amsl.com>; Fri, 1 Jun 2012 15:27:59 -0700 (PDT)
Received: from dovecot.org (dovecot.org [193.210.130.67]) by ietfa.amsl.com (Postfix) with ESMTP id 9B6AA11E8081 for <imap5@ietf.org>; Fri, 1 Jun 2012 15:27:59 -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 DBDD71AE87C5; Sat, 2 Jun 2012 01:27:58 +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: <20120601222311.GB598@launde.brong.net>
Date: Sat, 02 Jun 2012 01:27:58 +0300
Content-Transfer-Encoding: quoted-printable
Message-Id: <41D94689-2BBA-4E74-B6AE-CD6C75918A11@iki.fi>
References: <20120601222311.GB598@launde.brong.net>
To: Bron Gondwana <brong@fastmail.fm>
X-Mailer: Apple Mail (2.1084)
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: Fri, 01 Jun 2012 22:28:00 -0000

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.)