syncing mail by simply syncing the filesystem

Jesse Rosenthal jrosenthal at jhu.edu
Sat Jun 12 06:22:29 PDT 2010


> Another, potentially more elegant approach is to use "notmuch remote"
> scripts written by Jesse Rosenthal. I haven't done this myself, but I
> did think was feasible when I looked at them.

I'd certainly be happy to get some feedback on this idea, but I'm not
sure if it's the right tool for this problem, since it deals with
namespaces and he wants the universal namespace. In other words, I think
it mainly reduces to 'notmuch dump' and 'curl' there (though I could be
forgetting some cleverness on my part).

> On Sat, 12 Jun 2010 09:13:07 +0200, Christoph Groth <cwg at falma.de> wrote:
> > The ideal setup would be one which would allow to use any of my
> > computers independently (for example when I'm away with my laptop).
> > When necessary, the local mail stores would be synchronized by simply
> > syncing the home directory (I'm using unison for this).

Christoph -- some other ideas to think about:

1. If your other computers will have a consistent fast internet
connection (or a sufficient connection to use IMAP) consider remote
usage, keeping your database on one computer:

http://notmuchmail.org/remoteusage/

2. You could brute-force it. Include a nm_dump file as one of your
unison paths, along with your Maildir, then always run:

notmuch dump > nm_dump
unison
notmuch restore nm_dump

If you take a bit of care in how you tell unison nm_dump files, this
also has the benefit of not just assuming the most recent state is the
correct one. But the syntax is pretty easy, so that shouldn't be a
problem. I don't think unison lets you run hooks (I could be wrong), but
this could be easily scriptable.

2a. Just a thought -- would merging be easier if you used git/hg instead
of unison? Just make sure to gitignore your notmuch db.

3. Have an IMAP server on one computer, a notmuch-computer on
another. Have rsync passively pull down from your IMAP maildir. This
doesn't synchronize tags, but it might be good enough if you just want
to check on your phone occasionally.

FWIW, I have a combination of #3 and #1 above.

University --getmail/maildrop--> IMAP server --rsync--> home
                                                        / \
                                                       remote
                                                      /     \
                                                   work     laptop

Anyway, just some ideas. I'm sure there are plenty of others. (Sort of
curious to see them, since I'm sure there has been all sorts of
interesting hacks and workarounds). Everything above is sort of a hacks,
but it all works well enough for me. Hopefully there will be a canonical
solution to this sooner rather than later, though.

Best,
Jesse


More information about the notmuch mailing list