X-Git-Url: https://git.cworth.org/git?p=notmuch-wiki;a=blobdiff_plain;f=mutttips.mdwn;h=56a16298634baf5975e6363989f8914609b43792;hp=f8603e6e3a7e48e3b7c8551a248f4b696fb19c3a;hb=HEAD;hpb=61ba599cb7e5319b5988955788bcdce2c3ee7a56 diff --git a/mutttips.mdwn b/mutttips.mdwn index f8603e6..eb6bf8f 100644 --- a/mutttips.mdwn +++ b/mutttips.mdwn @@ -17,23 +17,25 @@ notmuch, or use a sets of scripts/handler within mutt to achieve something close There's a page about the [[notmuch-mutt]] scripts that are distributed along with notmuch, in its contrib directory. -# Using Notmuch with mutt-kz +# Using Notmuch with neomutt -Here is a tip about how to set up [mutt-kz](https://github.com/karelzak/mutt-kz), a fork -of the mutt MUA with support of notmuch integrated. +*Note*: This discussion was updated by a non-mutt user from talking about mutt-kz to +[neomutt](https://neomutt.org/). Caveat lector! -## Install: -You'll need to first have notmuch installed and the notmuch library available to -configure. Otherwise, it is a good old autoconf setup, so here it goes: +## Install: - git clone https://github.com/karelzak/mutt-kz.git - cd mutt-kz - ./configure && make && make install +See [the neomutt install page](https://neomutt.org/distro). If +building from source see [build +instructions](https://neomutt.org/dev/build/build). Note in particular +the `--notmuch` configuration option. ## Configuration: -Here is my `.muttrc` I use with `mutt-kz`, explainations as comments: +*N.B.* From here is unmodified previous discussion about `mutt-kz`, +which hopefully also applies to neomutt. + +Here is my `.muttrc` I use with `mutt-kz`, explanations as comments: # notmuch set nm_default_uri="notmuch:///PATH/TO/MY/Maildir" # path to the maildir @@ -46,11 +48,11 @@ Here is my `.muttrc` I use with `mutt-kz`, explainations as comments: "Sent" "notmuch://?query=tag:sent" # sets up queries for virtual folders # notmuch bindings macro index \\\\ "" # looks up a hand made query - macro index A "+archive -unread -inbox\\n" # tag as Archived - macro index I "-inbox -unread\\n" # removed from inbox - macro index S "-inbox -unread +junk\\n" # tag as Junk mail - macro index + "+*\\n" # tag as starred - macro index - "-*\\n" # tag as unstarred + macro index A "+archive -unread -inbox" # tag as Archived + macro index I "-inbox -unread" # removed from inbox + macro index S "-inbox -unread +junk" # tag as Junk mail + macro index + "+*" # tag as starred + macro index - "-*" # tag as unstarred # sidebar set sidebar_width = 20 set sidebar_visible = yes # set to "no" to disable sidebar view at startup @@ -75,20 +77,20 @@ the bindings defined in configuration (such as A/I/S/+/-). ## Mail tagging on sending -You may have noticed in `mutt-kz`'s configuration that I set the `sendmail` variable +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: @@ -103,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="-r inbox" + NOINBOX="-inbox" TAGS="" # manage dynamic tagging, using the ' + ' token in mail addresses @@ -112,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.