.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "NOTMUCH-MUTT 1"
.TH NOTMUCH-MUTT 1 2023-10-06 "perl v5.38.0" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
notmuch\-mutt \- notmuch (of a) helper for Mutt
.SH SYNOPSIS
.IX Header "SYNOPSIS"
.IP "\fBnotmuch-mutt\fR [\fIOPTION\fR]... search [\fISEARCH-TERM\fR]..." 4
.IX Item "notmuch-mutt [OPTION]... search [SEARCH-TERM]..."
.PD 0
.IP "\fBnotmuch-mutt\fR [\fIOPTION\fR]... thread < \fIMAIL\fR" 4
.IX Item "notmuch-mutt [OPTION]... thread < MAIL"
.IP "\fBnotmuch-mutt\fR [\fIOPTION\fR]... tag [\fITAGS\fR]... < \fIMAIL\fR" 4
.IX Item "notmuch-mutt [OPTION]... tag [TAGS]... < MAIL"
.PD
.SH DESCRIPTION
.IX Header "DESCRIPTION"
notmuch-mutt is a frontend to the notmuch mail indexer capable of populating
a maildir with search results.
.SH OPTIONS
.IX Header "OPTIONS"
.IP "\-o DIR" 4
.IX Item "-o DIR"
.PD 0
.IP "\-\-output\-dir DIR" 4
.IX Item "--output-dir DIR"
.PD
Store search results as (symlink) messages under maildir DIR. Beware: DIR will
be overwritten. (Default: \fI~/.cache/notmuch/mutt/results/\fR)
.IP \-p 4
.IX Item "-p"
.PD 0
.IP \-\-prompt 4
.IX Item "--prompt"
.PD
Instead of using command line search terms, prompt the user for them (only for
"search").
.IP \-r 4
.IX Item "-r"
.PD 0
.IP \-\-remove\-dups 4
.IX Item "--remove-dups"
.PD
Remove emails with duplicate message-ids from search results.  (Passes
\&\-\-duplicate=1 to notmuch search command.)  Note this can hide search
results if an email accidentally or maliciously uses the same message-id
as a different email.
.IP \-h 4
.IX Item "-h"
.PD 0
.IP \-\-help 4
.IX Item "--help"
.PD
Show usage information and exit.
.SH "INTEGRATION WITH MUTT"
.IX Header "INTEGRATION WITH MUTT"
notmuch-mutt can be used to integrate notmuch with the Mutt mail user agent
(unsurprisingly, given the name). To that end, you should define macros like
the following in your Mutt configuration (usually one of: \fI~/.muttrc\fR,
\&\fI/etc/Muttrc\fR, or a configuration snippet under \fI/etc/Muttrc.d/\fR):
.PP
.Vb 6
\&    macro index <F8> \e
\&    "<enter\-command>set my_old_pipe_decode=\e$pipe_decode my_old_wait_key=\e$wait_key nopipe_decode nowait_key<enter>\e
\&    <shell\-escape>notmuch\-mutt \-r \-\-prompt search<enter>\e
\&    <change\-folder\-readonly>\`echo ${XDG_CACHE_HOME:\-$HOME/.cache}/notmuch/mutt/results\`<enter>\e
\&    <enter\-command>set pipe_decode=\e$my_old_pipe_decode wait_key=\e$my_old_wait_key<enter>" \e
\&          "notmuch: search mail"
\&
\&    macro index <F9> \e
\&    "<enter\-command>set my_old_pipe_decode=\e$pipe_decode my_old_wait_key=\e$wait_key nopipe_decode nowait_key<enter>\e
\&    <pipe\-message>notmuch\-mutt \-r thread<enter>\e
\&    <change\-folder\-readonly>\`echo ${XDG_CACHE_HOME:\-$HOME/.cache}/notmuch/mutt/results\`<enter>\e
\&    <enter\-command>set pipe_decode=\e$my_old_pipe_decode wait_key=\e$my_old_wait_key<enter>" \e
\&          "notmuch: reconstruct thread"
\&
\&    macro index <F6> \e
\&    "<enter\-command>set my_old_pipe_decode=\e$pipe_decode my_old_wait_key=\e$wait_key nopipe_decode nowait_key<enter>\e
\&    <pipe\-message>notmuch\-mutt tag \-\- \-inbox<enter>\e
\&    <enter\-command>set pipe_decode=\e$my_old_pipe_decode wait_key=\e$my_old_wait_key<enter>" \e
\&          "notmuch: remove message from inbox"
.Ve
.PP
The first macro (activated by <F8>) prompts the user for notmuch search terms
and then jump to a temporary maildir showing search results. The second macro
(activated by <F9>) reconstructs the thread corresponding to the current mail
and show it as search results. The third macro (activated by <F6>) removes the
tag \f(CW\*(C`inbox\*(C'\fR from the current message; by changing \f(CW\*(C`\-inbox\*(C'\fR this macro may be
customised to add or remove tags appropriate to the users notmuch work-flow.
.PP
To keep notmuch index current you should then periodically run \f(CW\*(C`notmuch
new\*(C'\fR. Depending on your local mail setup, you might want to do that via cron,
as a hook triggered by mail retrieval, etc.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
\&\fBmutt\fR\|(1), \fBnotmuch\fR\|(1)
.SH AUTHOR
.IX Header "AUTHOR"
Copyright: (C) 2011\-2012 Stefano Zacchiroli <zack@upsilon.cc>
.PP
License: GNU General Public License (GPL), version 3 or higher
