unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Introducing notmuchsync
@ 2010-01-18 15:12 Sebastian Spaeth
  2010-01-18 15:24 ` Sebastian Spaeth
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Sebastian Spaeth @ 2010-01-18 15:12 UTC (permalink / raw)
  To: notmuch

Dear list,

I really want to sync my maildir flags/folders with notmuch tags and as
I haven't seen a script to do that, I've written (the beginnings of?)
one.

It is probably pre-alpha but I am a fan of release early, release often
and if someone finds it useful to build upon, it was already worth it. I
put the code here: http://github.com/spaetz/notmuchsync

What does it do?
================
 - Synchronizes the "S" flag with the "unread" tag (1-way). The
 synchronization direction is decided by using either --sync (change
 maildir flags according to notmuch) or --revsync (change notmuch tags according to maildir). By default it always checks the mails from the previous 30
 days (but can also do --all mails if you have plenty of RAM and time).
 - Deletes all mail files that have the "delete" tag
 - Quiet/normal/verbose logging 

Workflow
========
1a) start out with notmuchsync -r in order to initialize the notmuch tag
database based on maildir 'S' flags. This is probably what everyone but
Carl Worth wants. :-) If the "--all" command works for you, even better,
but I doubt it as it would store all your mails in RAM.
1b) start out with not

What needs improvment
=====================
 - It's a python script in one file. The architecture might need some
 cleanup. Documentation needs work too.
 - It temporarily slurps in all your mails from the last 30 days into
 RAM. I am waiting for "notmuchs show blah --output filename --output
 tags" to improve that :). Generally the parsing of the output of
 "notmuch show" is a bit hackyish with regexps at the moment.
 - Support parsing "chunks" of "notmuch show" output or do several
   runs for -all, using monthly intervals to make --all work.
 - Support for the "T" (delete), "F" (flag), "D" (draft) tags/flags.
   Should be pretty easy to add.
 - Support syncing of the "inbox" tag if the mail is in a dir different
 than INBOX. No clue yet how to do. Perhaps if a maildir name
 corresponds to a notmuch tag name, we move the mail there?
 - It seems to work for me, but is untested in environments with spaces
 in paths and windows machines.
 - the --doeverything command that prunes and syncs in one go

What else
=========
- It is GPL v2.1+
- Please improve and/or fork this thing.
- If you don't like it, just ignore it. Thanks for your understanding.

-----------------------------------------------------------------------
Usage:
-p --prune	Prune deleted mails
-s --sync	Sync from notmuch tags to maildir flags.
		By default it will only look for mails from the last 30 days.
		Use --all to look at earlier mails.
		Beware, if timestamps are more than 30 days in the
                future, 
                we won't handle it.
-r --revsync	Sync tags from maildir to notmuch. See also -s.
Options:
-d		 Really verbose debug oputput.
-q		 Log only errors.
--dryrun	 Do not really modify notmuch db or mail files
                 Works together with -p -s -r

----------------------------------------------------------------------

Let me know what you like or don't. If you want github contributor
right, I am willing to hand out access quite liberal. And as always:
patches welcome. :-)

spaetz

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

end of thread, other threads:[~2010-03-01 20:21 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-18 15:12 Introducing notmuchsync Sebastian Spaeth
2010-01-18 15:24 ` Sebastian Spaeth
2010-01-18 15:41 ` Michal Sojka
2010-01-18 15:57   ` Sebastian Spaeth
2010-01-19 13:37     ` Sebastian Spaeth
2010-01-19 15:00       ` Marten Veldthuis
2010-01-19 15:24         ` Jameson Rollins
2010-01-19 15:52           ` Sebastian Spaeth
2010-01-19 16:04             ` Jameson Rollins
2010-01-19 16:13               ` Sebastian Spaeth
2010-01-19 16:29               ` Servilio Afre Puentes
2010-01-19 16:38                 ` Jameson Rollins
2010-01-20  8:20               ` Tassilo Horn
2010-01-19 15:42         ` Sebastian Spaeth
2010-01-18 15:48 ` Marten Veldthuis
2010-02-24 18:19 ` Carl Worth
2010-02-24 18:49   ` Jameson Rollins
2010-02-25  9:50     ` Sebastian Spaeth
2010-02-25  9:40   ` Sebastian Spaeth
2010-03-01  8:57   ` Michal Sojka
2010-03-01 16:27     ` Ben Gamari
2010-03-01 17:18       ` Michal Sojka
2010-03-01 18:43         ` Ben Gamari
2010-03-01 20:20           ` Michal Sojka

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).