]> git.cworth.org Git - notmuch-wiki/blobdiff - mutttips.mdwn
News for release 0.38.3
[notmuch-wiki] / mutttips.mdwn
index ac4874cd2a1a817ef0aacb9e2e3db20e9aab9ae6..eb6bf8f19de4e5ee6beac56a2a75bfd013768145 100644 (file)
@@ -19,7 +19,7 @@ with notmuch, in its contrib directory.
 
 # Using Notmuch with neomutt
 
-*Note*: This discussion was updated by a non-mutt user from talking about mutt-kz to 
+*Note*: This discussion was updated by a non-mutt user from talking about mutt-kz to
 [neomutt](https://neomutt.org/). Caveat lector!
 
 
@@ -48,11 +48,11 @@ Here is my `.muttrc` I use with `mutt-kz`, explanations as comments:
             "Sent"      "notmuch://?query=tag:sent"        # sets up queries for virtual folders
         # notmuch bindings
         macro index \\\\ "<vfolder-from-query>"              # looks up a hand made query
-        macro index A "<modify-labels>+archive -unread -inbox\\n"        # tag as Archived
-        macro index I "<modify-labels>-inbox -unread\\n"                 # removed from inbox
-        macro index S "<modify-labels-then-hide>-inbox -unread +junk\\n" # tag as Junk mail
-        macro index + "<modify-labels>+*\\n<sync-mailbox>"               # tag as starred
-        macro index - "<modify-labels>-*\\n<sync-mailbox>"               # tag as unstarred
+        macro index A "<modify-labels>+archive -unread -inbox<enter>"        # tag as Archived
+        macro index I "<modify-labels>-inbox -unread<enter>"                 # removed from inbox
+        macro index S "<modify-labels-then-hide>-inbox -unread +junk<enter>" # tag as Junk mail
+        macro index + "<modify-labels>+*<enter><sync-mailbox>"               # tag as starred
+        macro index - "<modify-labels>-*<enter><sync-mailbox>"               # tag as unstarred
         # sidebar
         set sidebar_width   = 20
         set sidebar_visible = yes               # set to "no" to disable sidebar view at startup
@@ -79,18 +79,18 @@ the bindings defined in configuration (such as A/I/S/+/-).
 
 You may have noticed in `neomutts`'s configuration that I set the `sendmail` variable
 of mutt to a `nm_sendmail` script. This is for tagging outgoing mail each time I send
-a mail. Here is the content of the script (which may be used directly in mutt's 
-variable, I did not try). 
+a mail. Here is the content of the script (which may be used directly in mutt's
+variable, I did not try).
 
 Source of `nm_sendmail`:
 
         #!/bin/bash
-        tee >(notmuch-deliver -t sent -f Sent) | sendmail $*
+        tee >(notmuch insert --folder=Sent +sent) | sendmail $*
 
 ## Mail filtering/tagging
 
-For mail tagging on arrival, I prefer to use a simple procmail delivery along with 
-notmuch-delivery (which can be compiled in the `contrib/` directory of notmuch's sources).
+For mail tagging on arrival, I prefer to use a simple procmail delivery along with
+`notmuch insert`.
 
 Of course, you could use formail or maildrop, instead of procmail, but it is flexible
 enough for my needs, and here is an example of configuration that can be useful:
@@ -105,7 +105,7 @@ enough for my needs, and here is an example of configuration that can be useful:
         :0 Wh
         | /usr/local/bin/notmuch_abook update
 
-        NOINBOX="-inbox"
+        NOINBOX="-inbox"
         TAGS=""
 
         # manage dynamic tagging, using the ' + ' token in mail addresses
@@ -114,39 +114,39 @@ enough for my needs, and here is an example of configuration that can be useful:
         * ^TO\/user\+[a-z0-9]+@fqdn\.tld
         * MATCH ?? ^user\+\/[a-z0-9]+
         {
-        TAGS="-t ${MATCH}"
+        TAGS="+${MATCH}"
         }
 
         # match all mails from mailing-lists, don't let them go to inbox, but tag them with ml
         :0:notmuch.lock
         * ^List-[Ii][dD]:.*
         {
-        TAGS="${TAGS} -t ml -r inbox"
+        TAGS="${TAGS} +ml -inbox"
         }
 
         # tag all mails coming from mutt-kz mailing list
         :0:notmuch.lock
         * .*mutt-kz\.lists\.fedoraproject\.org.*
-        | notmuch-deliver $TAGS -t mutt -t notmuch
+        | notmuch insert $TAGS +mutt +notmuch
 
         # tag all mails coming from notmuch mailing list
         :0:notmuch.lock
         * .*notmuch\.notmuchmail\.org.*
-        | notmuch-deliver $TAGS -t notmuch
+        | notmuch insert $TAGS +notmuch
 
         # Mark all spams as junk mail
         :0:notmuch.lock
         * ^X-Spam-Status: Yes
-        | notmuch-deliver -t junk
+        | notmuch insert +junk
 
         :0:notmuch.lock
         * ^Subject: .*SPAM.*
-        | notmuch-deliver -t junk
+        | notmuch insert +junk
 
         ### All unmatched mails
         :0:notmuch.lock
         * .*
-        | notmuch-deliver -v $TAGS 
+        | notmuch insert $TAGS
 
 there's a line that updates the addressbook with addresses of current mail, and you'll
 be able to read more about it on the [[vimtips]] page.