unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* notmuch and imap [musing, no code :)]
@ 2009-12-15 12:05 David Bremner
  2009-12-16  0:54 ` Alec Berryman
  0 siblings, 1 reply; 5+ messages in thread
From: David Bremner @ 2009-12-15 12:05 UTC (permalink / raw)
  To: notmuch


Recent discussions on IRC (I forget with whom, sorry), brought me back
to thinking about syncing notmuch with imap.  In addition to the flags
\Seen, \Answered, \Draft, \Deleted, and \Flagged, imap servers can
optionally support user defined keywords (i.e. tags). At least courier
and dovecot do.  These keywords are imap "atoms", which, without tracing
though the BNF [1] completely look like they can can have (ascii)
alphanumeric, and punctuation other than brackets, quotes and "%", "*".

So the mapping is relatively nice between notmuch tags and imap
keywords.

One idea I had was to extend some imap syncing program to sync to
notmuch. mbsync (confusingly also named isync) is a C based one. It is
indeed relatively easy to add a new backend; I made a new "notmuch"
driver for mbsync in an hour or so that is actually just a maildir
driver.  I am a little discouraged by some of mbsync code (there are
lots of places with a buffer hard-coded to size 16, with a comment to
change that later when keyword support is added), but in principle, I
think this could work.  A more fundamental issue is that mbsync, like
most similar programs uses an index file to keep track of the sync
state, and it seems somehow wrong (or at least fragile) to keep a second
database with essentially the same information in it.

To write a custom sync program would require some imap code; this is
somewhere between trivial and not; mbsync's imap driver is about 1900
lines of C.  There is the uw c-client library; I remember some security
issues but that was more than a decade ago.  There are some newer
libraries like tinymail and libetpan, but they seem to have a whole
bunch of stuff not needed for notmuch.

d


[1]: http://www.faqs.org/rfcs/rfc3501.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-01-08  3:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-15 12:05 notmuch and imap [musing, no code :)] David Bremner
2009-12-16  0:54 ` Alec Berryman
2009-12-16 13:18   ` David Bremner
2009-12-16 14:29     ` Marten Veldthuis
2010-01-08  3:00     ` martin f krafft

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).