]> git.cworth.org Git - notmuch-wiki/blob - howto.mdwn
Move info about maildir synchronization out of emacstips, since it has
[notmuch-wiki] / howto.mdwn
1 [[!img notmuch-logo.png alt="Notmuch logo" class="left"]]
2 #How to...
3
4 * <span id="print_filenames">.. print only filenames of a search</span>
5
6 Given you have the python bindings installed (or simply set your PYTHONPATH environment variable to point to the .../bindings/python directory), this script will print the filenames of a matching search:
7
8                                 #!/usr/bin/env python
9                                 import sys
10                                 import notmuch
11                                 
12                                 q = notmuch.Database().create_query(" ".join(sys.argv[1:]))
13                                 for m in q.search_messages(): print m.get_filename()
14
15 * <span id="sync_maildir_flags">.. sync notmuch tags and maildir flags</span>
16
17   Some IMAP users rely on maildir flags that convey the status "seen",
18   "replied", "trashed", in order to synchronize the status of their
19   mail across mail clients (a [maildir
20   flag](http://cr.yp.to/proto/maildir.html) is simply a defined part
21   of their filename).  Notmuch will by default happily ignore those
22   flags and will never modify them either, as there is no built-in
23   support for sunchronizing your notmuch tags with your imap maildir
24   flags (seen, replied, trashed, etc). However there are currently 2
25   ways in which you can achieve synchronization.
26
27   [notmuchsync](http://spaetz.github.com/notmuchsync/) is a utility
28   that allows synchronization in either direction, as well as pruning
29   of deleted files.
30
31   The second solution allows for fast maildir flag to notmuch tag
32   synchronization (and only in that direction) requires patching the
33   notmuch source code. The patch has been posted in this mail
34   *id:1267450136-31749-1-git-send-email-Sebastian@SSpaeth.de* and can
35   be viewed as a [source diff in this git
36   repository](http://github.com/spaetz/notmuch-all-feature/commit/df3b087cefb85e9d16fd17540e348bcb854dd7ee).
37