[notmuch] proposal for more streamlined mail flow in notmuch

Jameson Rollins jrollins at finestructure.net
Sat Jan 16 12:49:55 PST 2010


I would like to put forth here a proposal for a couple of changes to
notmuch that I believe will considerably streamline message handling
and new message flow through notmuch.  Notmuch is still new and I
believe it hasn't quite figured out the best way to handle message
flow in the new mail handling paradigm that it is working.  This is a
proposal to fix that.

I believe that most people are syncing their mail from remote IMAP or
POP servers to local maildirs (via offlineimap for instance), and that
most people's IMAP servers have limited storage capacity.  This
practically means that people can not keep all of their mail in a
single directory.  However, notmuch currently basically assumes that
this is what is happening.  In order to keep synced maildirs from
growing out of hand, messages need to be either deleted or moved out
of the "inbox" where they initially show up.  This is why it was so
important for notmuch to get support for deletion/renaming/moving of
messages.

However, we still need to get notmuch to fundamentally understand this
flow (mail comes into inbox, and is then moved elsewhere), and provide
the functions to easily facilitate this flow for users.

To this end, here is how I believe the notmuch flow should look:

- New messages are delivered into a maildir "inbox".  When notmuch new
  is run, these new messages are tagged 'inbox' and 'unread'.

- When a user views a message with their reader, the 'unread' tag is
  automatically removed, the maildir S flag is added and the message
  is moved from inbox/new to inbox/cur.

- If the user wishes to delete a message, a 'delete' tag is added to
  the message.  If the user does a "purge", all messages tagged
  'delete' are erased from disk and/or a "delete hook" is run.

- If the user wishes to archive a message the 'inbox' tag is removed
  and the messages is actually moved from the inbox maildir into an
  archive maildir and/or an "archive hook" is run.

To fascilitate this, two new functions should be implemented at the
notmuch CLI level, so that things don't get fractured by different
mail reader implementations:

notmuch purge

  delete all 'delete' tagged messages, and/or execute "delete hooks"

notmuch archive <search-terms>

  remove 'inbox' flags from messages and move messages an archive
  maildir, and/or execute "archive hooks"

I believe this is a simple, intuitive flow, that will be easy to
understand and work with by pretty much all users, but is still very
nicely extensible for advanced users.  For instance, a delete hook
might move the message to a trash instead of deleting it outright, or
an "archive hook" could filter archived messages into folders.  Hooks
could also be used to do nothing to messages other than just modifying
the tags (which would completely mimic the current notmuch behavior).
The config file could be kept very simple (only two hooks would need
to be defined), without having to move to some crazy script-based
config scheme (like lua) that is overly complicated and very hard for
new users to understand.  It would also great simplify the mail
readers themselves (like the emacs UI), because it would greatly
reduce the number of commands (ie. essentially just "view", "delete",
"archive", or "search").

What do folks think of this proposal?  I am convinced that this flow
is simple, would be intuitive to new users, and extensible such that
it could provide the functionality that anyone could desire.  I would
be curious to hear of anyone interested in using notmuch who thinks
they could *not* achieve the mail flow that they desire with this
scheme.

Any and all feedback on this proposal is welcome.  If people think
this flow is a good idea, I would be psyched to start fleshing it out.

jamie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20100116/c3122573/attachment.pgp>


More information about the notmuch mailing list