Re: Message deletion wisdom

Subject: Re: Message deletion wisdom

Date: Tue, 03 Apr 2012 16:32:04 -0700

To: Jacek Generowicz, notmuch@notmuchmail.org

Cc:

From: Jameson Graef Rollins


On Tue, Apr 03 2012, Jacek Generowicz <jacek.generowicz@cern.ch> wrote:
> Looking through the archives of this list, I see that the topic of
> message deletion is, if not controversial, then at least non-trivial.
>
> + Requests for the provision of message deletion mechanisms have
>   appeared many times, and that various patches addressing the issue
>   have been submitted, and (IIUC) some of these are awaiting review
>   and might possibly make it into an official release in the future.
>
> + Having the 'deleted' tag cause messages to be deleted is,
>   apparently, fraught with peril of losing mail.

Hi, Jacek.  You are right on both of these points.  It has indeed been a
controversial topic.  However, I would say that we have reached a stasis
in terms of our response to this issue.  I'll try to summarize here.

I can say with a very high degree of certainly that notmuch will NEVER
gain the capability to actually delete mail files from disk itself.  It
is too risky for notmuch to be involved in that, and it's too easy to do
it outside of notmuch (e.g. "notmuch search --output=files tag:deleted |
xargs rm").  This has never really been up for discussion.

What *has* generated a lot of discussion is whether or not the emacs
interface should by default support key bindings that add a "deleted"
tag to messages, and how that tag should be handled.  I think we have
finally settled on notmuch NOT supporting such a key binding by default,
since it's easy enough for users to add the binding themselves if they
wish.

What we have added (or more accurately "are adding") though (thanks to
the work of Austin Clements and Mark Walters) is the ability to exclude
messages with a certain tag from search results.  This is like an
effective deletion, since messages can be completely omitted from search
results without having them actually be deleted from disk.  This is
obviously much safer, and a more generally useful functionality.  This
functionality is currently in beta, but will be full-featured in the
next release.

So in summary, if you would like to "delete" messages, you can:

 * add a key binding to emacs (or your favorite ui) to add a "deleted"
   tag to messages that you want to delete:

    (define-key notmuch-show-mode-map "d"
      (lambda ()
        (interactive)
        (notmuch-show-tag-message "+deleted")))

 * add exclusion for messages with the "deleted" tag:

    notmuch config set search.exclude_tags deleted

 * and if you really want them purged from disk, delete them manually
   with:

    notmuch search --output=files tag:deleted | xargs -l rm

I'll add a page about this to the wiki, since it comes up enough.

hth.

jamie.
part-000.sig (application/pgp-signature)

Thread: