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