Hi All,<div><br></div><div>About two of three months ago, I stopped using notmuch because for some reason notmuch refused to import the maildir produced by offlineimap with the weird no thread id error. I passed along some of the messages notmuch was failing on to cworth but they imported fine for him. At that point I switched to just using work webmail and gmail. I also got an android phone and so the syncing issue became a serious issue.</div>
<div><br></div><div>I miss notmuch, a lot. It's pretty clearly the mailer UI and to a lesser extent backend I've always wanted, and so I'm just about ready to try and switch back again. It's just, the syncing problem is a huge one. Not only do I now have a phone in the mix, but I'm no longer using my personal computer for work (I have a work desktop and laptop that need to be in sync too!) There is an upside though, since $NEWJOB is at Google, I'm now using gmail for all my email. :)</div>
<div><br></div><div>With all that in mind, I've started to think seriously about the syncing problem. Thanks to gmail labels being close to, if not equal to notmuch tags, I believe it's possible to have a full sync between a remote gmail account and (many) notmuch dbs.</div>
<div><br></div><div>The basic plan is to use gmail's terrible IMAP support (I've already complained about it :), since it's powerful enough information to do label syncing. [GMail]/All Mail folder will be streamed out to probably an Mh directory. Every n messages notmuch new gets called and then a remove of inbox tag is done for every message added (would be nice to be able to get notified of which messages were visited, but shouldn't be necessary). Soon after the gmail syncer daemon will do a folder/label scan and call a bunch of notmuch add's for all the newly added label, message-id pairs (yeah, this part is pretty hand wavy). That should  get the gmail -> notmuch state complete with gmail labels working properly.</div>
<div><br></div><div>The reverse counts on notmuch getting support for hooks for tag add and remove events, that can enqueue a a tag, message-id pair with the gmail syncer daemon that can then copy or remove the messages from the appropriate Label/Folders in IMAP.</div>
<div><br></div><div>I suspect getting this to run efficiently will be hard, but I think the basic principle should allow close to full bidirectional syncing with gmail labels.</div><div><br></div><div>alex</div><div><br></div>
<div><br></div>