[notmuch] Introducing notmuchsync
authorSebastian Spaeth <Sebastian@SSpaeth.de>
Mon, 18 Jan 2010 15:12:28 +0000 (16:12 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:36:00 +0000 (09:36 -0800)
d3/cc0166e509cbd06bf597e674df22b7ef8af6dd [new file with mode: 0644]

diff --git a/d3/cc0166e509cbd06bf597e674df22b7ef8af6dd b/d3/cc0166e509cbd06bf597e674df22b7ef8af6dd
new file mode 100644 (file)
index 0000000..69d54db
--- /dev/null
@@ -0,0 +1,124 @@
+Return-Path: <Sebastian@SSpaeth.de>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 98CC5431FBC\r
+       for <notmuch@notmuchmail.org>; Mon, 18 Jan 2010 07:12:35 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.001\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.001 tagged_above=-999 required=5\r
+       tests=[BAYES_50=0.001] autolearn=ham\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id OYaUPWnizHK4 for <notmuch@notmuchmail.org>;\r
+       Mon, 18 Jan 2010 07:12:34 -0800 (PST)\r
+Received: from mout.perfora.net (mout.perfora.net [74.208.4.194])\r
+       by olra.theworths.org (Postfix) with ESMTP id CC541431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 18 Jan 2010 07:12:34 -0800 (PST)\r
+Received: from homiemail-a21.g.dreamhost.com (caiajhbdcbbj.dreamhost.com\r
+       [208.97.132.119]) by mx.perfora.net (node=mxus2) with ESMTP (Nemesis)\r
+       id 0MStEz-1NNAU30eNp-00RpIY for notmuch@notmuchmail.org;\r
+       Mon, 18 Jan 2010 10:12:34 -0500\r
+Received: from sspaeth.de (mtec-hg-docking-2-dhcp-062.ethz.ch [82.130.121.62])\r
+       by homiemail-a21.g.dreamhost.com (Postfix) with ESMTPA id C1F9630006C\r
+       for <notmuch@notmuchmail.org>; Mon, 18 Jan 2010 07:12:31 -0800 (PST)\r
+Received: by sspaeth.de (sSMTP sendmail emulation);\r
+       Mon, 18 Jan 2010 16:12:28 +0100\r
+From: "Sebastian Spaeth" <Sebastian@SSpaeth.de>\r
+To: notmuch@notmuchmail.org\r
+Date: Mon, 18 Jan 2010 16:12:28 +0100\r
+Message-ID: <87pr57jvkz.fsf@SSpaeth.de>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Subject: [notmuch] Introducing notmuchsync\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 18 Jan 2010 15:12:35 -0000\r
+\r
+Dear list,\r
+\r
+I really want to sync my maildir flags/folders with notmuch tags and as\r
+I haven't seen a script to do that, I've written (the beginnings of?)\r
+one.\r
+\r
+It is probably pre-alpha but I am a fan of release early, release often\r
+and if someone finds it useful to build upon, it was already worth it. I\r
+put the code here: http://github.com/spaetz/notmuchsync\r
+\r
+What does it do?\r
+================\r
+ - Synchronizes the "S" flag with the "unread" tag (1-way). The\r
+ synchronization direction is decided by using either --sync (change\r
+ maildir flags according to notmuch) or --revsync (change notmuch tags according to maildir). By default it always checks the mails from the previous 30\r
+ days (but can also do --all mails if you have plenty of RAM and time).\r
+ - Deletes all mail files that have the "delete" tag\r
+ - Quiet/normal/verbose logging \r
+\r
+Workflow\r
+========\r
+1a) start out with notmuchsync -r in order to initialize the notmuch tag\r
+database based on maildir 'S' flags. This is probably what everyone but\r
+Carl Worth wants. :-) If the "--all" command works for you, even better,\r
+but I doubt it as it would store all your mails in RAM.\r
+1b) start out with not\r
+\r
+What needs improvment\r
+=====================\r
+ - It's a python script in one file. The architecture might need some\r
+ cleanup. Documentation needs work too.\r
+ - It temporarily slurps in all your mails from the last 30 days into\r
+ RAM. I am waiting for "notmuchs show blah --output filename --output\r
+ tags" to improve that :). Generally the parsing of the output of\r
+ "notmuch show" is a bit hackyish with regexps at the moment.\r
+ - Support parsing "chunks" of "notmuch show" output or do several\r
+   runs for -all, using monthly intervals to make --all work.\r
+ - Support for the "T" (delete), "F" (flag), "D" (draft) tags/flags.\r
+   Should be pretty easy to add.\r
+ - Support syncing of the "inbox" tag if the mail is in a dir different\r
+ than INBOX. No clue yet how to do. Perhaps if a maildir name\r
+ corresponds to a notmuch tag name, we move the mail there?\r
+ - It seems to work for me, but is untested in environments with spaces\r
+ in paths and windows machines.\r
+ - the --doeverything command that prunes and syncs in one go\r
+\r
+What else\r
+=========\r
+- It is GPL v2.1+\r
+- Please improve and/or fork this thing.\r
+- If you don't like it, just ignore it. Thanks for your understanding.\r
+\r
+-----------------------------------------------------------------------\r
+Usage:\r
+-p --prune     Prune deleted mails\r
+-s --sync      Sync from notmuch tags to maildir flags.\r
+               By default it will only look for mails from the last 30 days.\r
+               Use --all to look at earlier mails.\r
+               Beware, if timestamps are more than 30 days in the\r
+                future, \r
+                we won't handle it.\r
+-r --revsync   Sync tags from maildir to notmuch. See also -s.\r
+Options:\r
+-d              Really verbose debug oputput.\r
+-q              Log only errors.\r
+--dryrun        Do not really modify notmuch db or mail files\r
+                 Works together with -p -s -r\r
+\r
+----------------------------------------------------------------------\r
+\r
+Let me know what you like or don't. If you want github contributor\r
+right, I am willing to hand out access quite liberal. And as always:\r
+patches welcome. :-)\r
+\r
+spaetz\r