]> git.notmuchmail.org Git - notmuch-wiki/blob - faq.mdwn
NEWS for release 0.23.4
[notmuch-wiki] / faq.mdwn
1 [[!img notmuch-logo.png alt="Notmuch logo" class="left"]]
2 # Frequently Asked Questions
3
4 [[!toc levels=2]]
5
6 ## How come this query matches mails in folder:2013? `notmuch search --output=files folder:inbox`
7
8 You have duplicates of a message (or messages) in both folders.
9
10 Notmuch searches are message based. Multiple files may be associated
11 with the same message (i.e. the files have identical Message-ID). A
12 `folder:` search will match the folder of any of the files. The
13 `--output=files` option outputs all the files of all matching messages.
14
15 ## Shouldn't notmuch support inline PGP?
16
17 [Why it might not be a good idea](https://dkg.fifthhorseman.net/notes/inline-pgp-harmful/)
18
19 ## How do I delete messages
20
21 See [[excluding]].
22
23 ## How do I configure the citation line when replying in Emacs?
24
25         (setq message-citation-line-format "On %a, %d %b %Y, %f wrote:")
26         (setq message-citation-line-function 'message-insert-formatted-citation-line)
27
28 See help for `message-citation-line-format` for details.
29
30 ## How do I search for messages that have no tags?
31
32 Unfortunately, there is no way to do this directly.
33
34 However, it's possible to accomplish this using two searches in shell. First,
35 you need to query all tags in the database, and transform the result into a
36 query that matches messages that have none of those tags:
37
38         $ notmuch search --output=tags \* | sed 's/^/not tag:/;2~1s/^/and /'
39
40 Next, use that to query the messages:
41
42         $ notmuch search $(notmuch search --output=tags \* | \
43                 sed 's/^/not tag:/;2~1s/^/and /')
44
45 ## How do I search for punctuation, specific special characters, or regexp?
46
47 Please see the [[notmuch-search-terms manual
48 page|manpages/notmuch-search-terms-7]] first.
49
50 The main thing to understand is that Xapian, and therefore Notmuch, searches are
51 closer to natural language searches than regular expression
52 searches. Punctuation is mostly ignored.
53
54 The boolean prefix searches (see Boolean and Probabilistic Prefixes in the man
55 page), such as tag: or path: searches, need an exact match.
56
57 ## How do I search for the `List-Id:` header?
58
59 Currently there is no way to search for `List-Id:`. As a workaround, try using a
60 `to:` prefix search (which covers both `To:` and `Cc:` headers) on the mailing
61 list address.
62
63 Limitations in the duplicate message handling are the main reason for not
64 indexing the `List-Id:` header. If you receive the same message via both the
65 list and directly (by way of `To:` or `Cc:`), only the first message encountered
66 will be indexed. Only the message received via the list will have `List-Id:`,
67 but you would expect a `List-Id:` search to find the message, regardless of the
68 order in which the duplicates were received. This is a more general problem than
69 just `List-Id:`, and once this has been resolved, adding `List-Id:` indexing is
70 trivial.
71
72 ## Can I use notmuch with grsec?
73
74 Sure! It works out of the box. If you have TPE enabled (trusted path execution),
75 make sure the user is executing the script belongs to the
76 `kernel.grsecurity.tpe_gid` (in debian this is grsec-tpe).
77 This is required in order to run the `pre-new` and `post-new` hooks.
78
79 ## Can I tag threads?
80
81 No. Tagging is message based.
82
83 It is possible, however, to make tags propagate to all messages in a thread
84 using a little bit of scripting in the [[post-new
85 hook|manpages/notmuch-hooks-5]]. For example, to add the muted tag to all
86 messages in threads that have at least one message with the muted tag:
87
88         THREAD_TAGS="muted"
89         for tag in "$THREAD_TAGS"; do
90                 notmuch tag +$tag $(notmuch search --output=threads tag:$tag)
91         done
92
93 You can add other tags to `THREAD_TAGS` as needed. Note that this is one way
94 only; you need to explicitly remove the tag from all the messages in a thread to
95 stop it from propagating again.