Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 268 lines (182 sloc) 8.175 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267
notmuch support for mutt
------------------------

 * notmuch is e-mail fulltext indexing and tagging engine; see
   http://notmuchmail.org/ for more information.

 * home page (wiki)

   https://github.com/karelzak/mutt-kz

 * mailing list:

   https://admin.fedoraproject.org/mailman/listinfo/mutt-kz

 * requirements:

   notmuch >= 0.9

 * compile:

  $ git clone git://github.com/karelzak/mutt-kz.git
  $ cd mutt-kz
  $ ./prepare
  $ ./configure --enable-notmuch [--enable-debug]
  $ make


 * Folders URI

   notmuch://[<path>][?<item>=<name>[& ...]]

   The <path> is an absolute path to the directory where the notmuch database
   is found as returned by 'notmuch config get database.path' command. Note that
   the <path> should NOT include .notmuch directory name.

   If the "<path>" is not defined then $nm_default_uri is used, for example:

set nm_default_uri = "notmuch:///home/foo/maildir"
virtual-mailboxes "My INBOX" "notmuch://?query=tag:inbox"

   Items:

      query=<string>

See SEARCH SYNTAX in notmuch man page. Don't forget to use "and" and
         "or" operators in your queries.

      Note that proper URI should not contain blank space and all "bad" chars
      should be encoded, for example

"tag:AAA and tag:BBB" --encoding-> tag:AAA%20and%20tag:BBB

      but mutt config file parser is smart enough to accept space in quoted
      strings. It means that you can use

         "notmuch:///foo?query=tag:AAA and tag:BBB"

      in your config files to keep things readable.

   See http://xapian.org/docs/queryparser.html for more details about Xapian
   queries.


 * commands:

   change-vfolder:
      - switch to another virtual folder
      - default key: X

   vfolder-from-query:
      - generate new virtual folder from notmuch search query
      - default key: <Esc>X

   modify-labels:
      - add or remove notmuch tags; [+]<tag> to add, -<tag> to remove
      - default key: `
      - example: "+AAA +BBB -CCC"

   modify-labels-then-hide:
      - same as <modify-labels> but message is marked by <quasi-delete>
      - not mapped to any key
      - example (add "archive" notmuch tag and remove message from screen):

       macro index A "<modify-labels-then-hide>+archive -inbox\n<sync-mailbox>"
       macro index I "<modify-labels-then-hide>-inbox\n<sync-mailbox>"

   quasi-delete:
      - delete message from mutt (usualy after <sync-mailbox> function), but
        don't touch message on disk


 * muttrc:

   Note that you can use notmuch specific mutt config file, see -F <config> in
   mutt docs.


   virtual-mailboxes <description> <uri> [ ...]

      This command specifies one or more virtual folder. The folders are
      accessioble by command 'X'.
 
      example:

      virtual-mailboxes "Linux Kernel" "notmuch:///whereis/db?query=tag:lkml&limit=1000" \
                        "Filesystems" "notmuch:///whereis/db?query=tag:fs" \
                        "Music" "notmuch:///another/db?query=tag:hard and tag:heavy"

   virtual_spoolfile = <boolean>

      When set, mutt will use the first virtual mailbox (see virtual-mailboxes)
      as a spoolfile.

      When set together with sidebar, mutt will use list of virtual folders in
      the sidebar. It's possible to toggle between virtual and normal folders by
      sidebar-toggle command.

   nm_open_timeout = <seconds>

      This option specifies timeout for Notmuch database. Default is 5 seconds.

   nm_default_uri = <uri>

      This variable specifies the default Notmuch database in format
      notmuch://<absolute path>, the URI is used for notmuch queries (ESC+X) when
      the current folder is not based on notmuch.

   nm_hidden_tags = <comma delimited list>

      This variable specifies private notmuch tags which should not be printed
      on screen (index, pager).

      Default is "unread,draft,flagged,passed,replied,attachment".

   nm_unread_tag = <name>

      This variable specifies notmuch tag which is used for unread messages. The
      variable is used to count unread messages in DB only. All other mutt
      commands use standard (e.g. maildir) flags.

      Default is "unread".

   vfolder_format = <string>

      This variable allows you to customize the file browser display for virtual
      folders to your personal taste. This string is similar to $index_format,
      but has its own set of printf(3)-like sequences:

%f folder name (description)
%n number of all messages
%N number of new messages
%>X right justify the rest of the string and pad with character ``X''
%|X pad to the end of the line with character ``X''
%*X soft-fill with character ``X'' as pad

      Default is "%6n(%6N) %f ".

   index_format and pager_format

        %g notmuch tags (labels)


 * TODO:

   add "entire-thread" command

      to display all e-mails that belongs to the same thread as the current
      message. This command will be useful when you have a new email ion your INBOX
      and you want to see the rest of the archived thread.


* .muttrc example:

set nm_default_uri="notmuch:///home/kzak/Mail/Maildir"
set virtual_spoolfile = yes

# normal folders
set mbox_type=Maildir
set folder="~/Mail/Maildir"
mailboxes =rh =fedora =misc

# sidebar
set sidebar_width = 35
set sidebar_visible = yes
color sidebar_new yellow default
bind index <left> sidebar-prev
bind index <right> sidebar-next
bind index <space> sidebar-open
bind index <Esc>S sidebar-toggle

        # virtual folders
virtual-mailboxes \
"INBOX" "notmuch://?query=tag:inbox and NOT tag:archive" \
"Util-linux" "notmuch://?query=tag:ul and NOT tag:archive" \
"Bugs" "notmuch://?query=tag:bug NOT tag:archive" \
"RH" "notmuch://?query=tag:rh and NOT tag:archive" \
"Fedora" "notmuch://?query=tag:fed and NOT tag:archive" \
"Linux" "notmuch://?query=tag:lk and NOT tag:archive" \
"NFS" "notmuch://?query=tag:nfs and NOT tag:archive" \
"Filesystems" "notmuch://?query=tag:fs and NOT tag:archive" \
"Security" "notmuch://?query=tag:sec" \
"Partitioning" "notmuch://?query=tag:part" \
"GNU" "notmuch://?query=tag:gnu" \
"udev" "notmuch://?query=tag:udev" \
"initrd" "notmuch://?query=tag:initrd" \
"Linux CZ" "notmuch://?query=tag:cz" \
"Notmuch" "notmuch://?query=tag:nm" \
"Procps" "notmuch://?query=tag:proc" \
\
" Util-linux [archive]" "notmuch://?query=tag:ul and tag:archive" \
" Bugs [archive]" "notmuch://?query=tag:bug and tag:archive" \
" RH [archive]" "notmuch://?query=tag:rh and tag:archive" \
" Fedora [archive]" "notmuch://?query=tag:fed and tag:archive" \
" Linux [archive]" "notmuch://?query=tag:lk and tag:archive" \
" Filesystems [archive]" "notmuch://?query=tag:fs and tag:archive" \

macro index A "<modify-labels-then-hide>+archive -inbox\n<sync-mailbox>"
macro index I "<modify-labels-then-hide>-inbox\n<sync-mailbox>"

# mark emails for git-am
# (e.g. "git am -i -3 $(notmuch search --output=files tag:PATCH)"
#
macro index P "<modify-labels>PATCH\n"
macro index <Esc>P "<modify-labels>-PATCH\n"


* .procmailrc example:

NOINBOX="-r inbox"

### Add 'kw' (keyword) tag to all interesting e-mails and make the emails
### visible in inbox.
:0
* ^Subject:.*(mount|umount|libmount|losetup|util-linux|blkid|hwclock|mkswap|fdisk|parted|partition|gpt|topology)
{
TAGS="-t kw"
NOINBOX=""
}

### Lists

:0:notmuch.lock
* ^List-Id:.*linux.linux.cz
| notmuch-deliver $NOINBOX -t cz $TAGS linux.cz

:0:notmuch.lock
* ^X-Mailing-List:.*util-linux@vger.kernel.org
| notmuch-deliver -t ul $TAGS util-linux

:0:notmuch.lock
* ^List-Id:.*parted-devel.lists.alioth.debian.org
| notmuch-deliver $NOINBOX -t part $TAGS parted

### [...cut to make the example short...] ###

### All unmatched mails
:0:notmuch.lock
* ^From
| notmuch-deliver $TAGS misc

### fallback if notmuch does not work
:0:
* ^From
Mail/Maildir/misc/



Something went wrong with that request. Please try again.