tags/muttzack's home pagehttp://upsilon.cc/~zack/tags/mutt/zack's home pageikiwiki2015-03-09T09:21:47Zinterview for The Setuphttp://upsilon.cc/~zack/blog/posts/2015/03/interview_for_The_Setup/2015-03-09T09:21:47Z2015-03-09T09:21:47Z
<h1>my setup, take #2</h1>
<p>Look Ma, I've been <a href=
"http://stefano.zacchiroli.usesthis.com/">interviewed</a> by
<a href="http://usesthis.com/">The Setup</a>, a popular blog with
<em>"interviews asking people from all walks of life what they use
to get the job done"</em>; so I now sport a fancy <a href=
"http://stefano.zacchiroli.usesthis.com">http://stefano.zacchiroli.usesthis.com</a>
too.</p>
<p>While there is overlap with <a href=
"http://upsilon.cc/~zack/blog/posts/2014/09/interview_for_the_gnu_linux_setup/">my
previous take</a> on my setup, the questions are different so most
of the content is novel. In particular, I quite enjoyed the
question about what would be my "dream setup", and indulged in free
software/hardware desiderata.</p>
<p>Many thanks to Daniel Bogan for running the blog and kudos for
his editing work: while it's just a detail, such an abundance and
quality of link titles is not easy to come by on the Web.</p>
interview for the gnu linux setuphttp://upsilon.cc/~zack/blog/posts/2014/09/interview_for_the_gnu_linux_setup/2014-09-03T14:02:16Z2014-09-03T08:48:14Z
<h1>my setup, take #1</h1>
<p>Among the various things I've catched up with during the summer,
I've finally managed to set aside some time to answer a pending
<a href=
"http://www.mylinuxrig.com/post/96462880004/the-linux-setup-stefano-zacchiroli-former-debian">
interview</a> request for <a href=
"http://www.mylinuxrig.com/setup">The [GNU/]Linux Setup</a>: a blog
run by Steven Ovadia that collects interviews about how people use
GNU/Linux-based desktops.</p>
<p>In the interview I discuss my day to day work-flow, from GNOME
Shell to Mutt, from Emacs to Notmuch, and the various glue code
tools I've written for integrating them.</p>
<p><a href=
"http://www.mylinuxrig.com/post/96462880004/the-linux-setup-stefano-zacchiroli-former-debian">
Enjoy</a>!</p>
<p>Feedback is most welcome.</p>
org-mutt ported to org-capturehttp://upsilon.cc/~zack/blog/posts/2013/10/org-mutt_ported_to_org-capture/2013-10-17T07:40:07Z2013-10-17T07:38:11Z
<h1>org-mutt with org-mode >= 8</h1>
<p>Thanks to <a href=
"http://www.donarmstrong.com/posts/org_mode_mutt_capture/">Don</a>
I just remembered that I haven't yet announced org-mutt support for
org-mode >= 8. Let's catch up!</p>
<p>Since a few weeks I've been aware of the fact that my <a href=
"http://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/"><strong>mutt/org-mode
glue</strong></a>, AKA <strong>org-mutt</strong>, was no longer
working with <a href="http://orgmode.org/">org-mode</a> >= 8,
due to the ditching of org-remember in favor of org-capture.
Allegedly, org-capture should have been backward compatible, but it
clearly is not.</p>
<p>Before I had time to fix it myself, <a href=
"http://mako.cc/">Mako</a> came to my rescue and submitted <a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=commit;h=ec7aa6e44ef39a2645ec40f1fe1700a7af47544f">
a patch</a> (now accepted) that does the needed porting. Free
Software is truly amazing, isn't it?</p>
<p>I've just updated the canonical <a href=
"http://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/">org-mutt
blog post</a>, so that the documentation in there is up to date
again. If you're using org-mutt, I suggest to refer to the <a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=summary"><strong>Git
repository</strong></a> as the canonical location for future
updates, if any.</p>
<p>Thanks Don, thanks Mako!</p>
mutt-notmuch is deadhttp://upsilon.cc/~zack/blog/posts/2012/03/mutt-notmuch_is_dead/2012-03-31T09:39:29Z2012-03-31T09:26:11Z
<h1>long life to notmuch-mutt</h1>
<ul>
<li><em>Bad news</em>: I've <a href=
"https://gitorious.org/mutt-notmuch/mutt-notmuch/commit/c0934762614476f563e9d19d2a8e3d97547d0f1f">
just killed</a> <a href=
"http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/">mutt-notmuch</a></li>
<li><em>Good news</em>: <strong>mutt-notmuch has been integrated
upstream</strong> as a notmuch <a href=
"http://git.notmuchmail.org/git/notmuch/tree/HEAD:/contrib/notmuch-mutt">
contrib script</a> <strong>under the name
notmuch-mutt</strong><br />
<small>(note the word switch, due to uniformity with other tools of
the notmuch suite)</small></li>
<li><em>Good news</em> (for Debian users): starting with next
notmuch upload <strong>there will be a Debian
<code>notmuch-mutt</code> package</strong>. It will work out of the
box with Mutt, without requiring any <code>~/.muttrc</code>
fiddling</li>
</ul>
<p>As a consequence, no further separate releases of mutt-notmuch
will be made. Future releases (of notmuch-mutt) will happen as part
of notmuch.</p>
<p>In other news, several changes have been implemented in
notmuch-mutt wrt mutt-notmuch 0.2:</p>
<ul>
<li>move cache dir to <code>~/.cache/notmuch/mutt/</code> by
default<br />
<small>(Note: given that, from the point of view of notmuch, the
next one will be the <em>first</em> release, no migration code from
the previous cache location is present. Please switch to the new
version and get rid of <code>~/.mutt-notmuch*</code>
manually.)</small></li>
<li>support for <a href=
"http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html">
XDG basedir</a>, allowing to override the cache dir</li>
<li>switch to String::ShellQuote for proper shell escaping in all
notmuch calls</li>
<li>system-wide Mutt configuration snippet for
<code>/etc/Muttrc.d/</code> (Debian-specific) or
<code>/etc/Muttrc</code></li>
</ul>
<hr />
<p>Many thanks to David Bremner (for shepherding my changes in) and
to Ben Boeckel (whose desire to package mutt-notmuch in Fedora made
me kick <a href="http://bugs.debian.org/628018">Debian bug
#628018</a>, this time for real).</p>
mutt-notmuch 0.2http://upsilon.cc/~zack/blog/posts/2012/02/mutt-notmuch_0.2/2012-02-11T14:15:20Z2012-02-11T14:15:20Z
<p>My <a href=
"http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/">mutt-notmuch
hack</a> seems to be a quite popular way to integrate <a href=
"http://www.mutt.org/">Mutt</a> with <a href=
"http://notmuchmail.org/">notmuch</a>. As a nice consequence, my
(indexed!) inbox attracts patches from mutt-notmuch users eager to
improve it. Collecting some of them, I've just tagged <a href=
"https://gitorious.org/mutt-notmuch/mutt-notmuch/trees/0.2">mutt-notmuch
0.2</a> with the following changes:</p>
<ul>
<li>readline support and query history</li>
<li>support for spaces in mailboxes (use case:
gmail+offlineimap)</li>
<li>a new "tag" action</li>
<li>normalization of <code>=names</code> to support mutt macros
that pass folder names</li>
<li>do not treat <code>+opt</code> as a valid cmdline option (to
ease tagging)</li>
</ul>
<p>Many thanks to Scott Barker, Christine Spang, David Newgas, and
Ryan Kavanagh for the above patches.</p>
<p>While I was at it, I've also moved mutt-notmuch repository
<a href="https://gitorious.org/mutt-notmuch/">to Gitorious</a>. Git
self-hosting is nice, but either you move to something like
gitolite (which I didn't have time to setup and tune ATM) or you're
stuck without merge requests which are quite nice. <small>(Why not
Github? <a href=
"http://mako.cc/writing/hill-free_tools.html">Because.</a>)</small></p>
<p>If you're using mutt-notmuch you might also be interested in the
discussion of <a href=
"http://thread.gmane.org/gmane.mail.notmuch.general/7310">libnotmuch
support in mutt</a>. I'd love to see that landing in mutt and be
able to throw away mutt-notmuch entirely, but that seems a bit
premature as of yet.</p>
how to use Notmuch with Mutthttp://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/2012-03-31T09:29:50Z2011-02-03T18:09:42Z
<h1>Mutt mail indexing on steroids!</h1>
<p><strong>Update 31/03/2012: <a href=
"http://upsilon.cc/~zack/blog/posts/2012/03/mutt-notmuch_is_dead/">mutt-notmuch has
been integrated upstream</a> under the name
notmuch-mutt.</strong></p>
<p>I've been using external mail indexing with <a href=
"http://www.mutt.org">Mutt</a> for quite a while now. Before now I
haven't given <a href="http://notmuchmail.org/">Notmuch</a> a try,
as it seemed <em>too much</em> experimental at the time of my
initial <a href=
"http://upsilon.cc/~zack/blog/posts/2009/10/mail_indexing_for_mutt/">review of mail
indexing tools</a>.</p>
<p>As there is nothing better than a long oversea flight to
perpetrate new hacks, I've now not only tested it, but also
<strong>switched to Notmuch</strong> without looking back at
<a href="http://code.google.com/p/mu0/">maildir-utils</a> for a
split second.</p>
<p>Getting started with Notmuch is trivial:</p>
<ul>
<li>Notmuch is <a href=
"http://packages.debian.org/sid/notmuch">notmuch</a> in Debian (and
maintained by upstream author, thanks!)</li>
<li><code>notmuch setup</code> asks a few questions about the user
and then prepare a template <code>~/.notmuch-config</code>, which
is good enough to start</li>
<li><code>notmuch new</code> does a first run of indexing (which
might take a while, depending on the size of your maildirs)</li>
</ul>
<p>Some performance figures: (1) the size of the index is a bit
larger than the size of the mails (on my laptop: 535 Mb of index vs
375 Mb of mails stored in 60 maildirs); (2) even if the underlying
indexing engine is the same (Xapian) as maildir-utils, Notmuch is
much faster. With my setup it is so fast that I've added it as a
hook triggered by offlineimap at the end of each
synchronization:</p>
<pre><code> zack@usha:~$ grep -B 1 hook .offlineimaprc
[Account Upsilon]
postsynchook = notmuch new
</code></pre>
<p>With the big round of new mail downloaded in the morning, it
hardly takes more than a few seconds to update Notmuch index, while
with other periodic downloads Notmuch almost invariably reports
"... in almost no time" (i.e. less than 1 second).</p>
<h2>Integrating Notmuch with Mutt</h2>
<p>The basic integration I want between Mutt and a mail indexer is
the ability of stating a <strong>search query</strong>
interactively and then jump to a <strong>fresh Maildir containing
search results</strong> only. Additionally, given that Notmuch has
neat <strong>thread reconstruction</strong> abilities, I also want
to be able to reconstruct on the fly the thread corresponding to
the currently highlighted mail: it comes handy when a thread has
been split across different maildirs, archived, or the like.</p>
<p>To that end, I've cooked up a little helper, called <a href=
"http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/mutt-notmuch">
mutt-notmuch</a>, that enables to trigger mail searches via a Mutt
macro (F8 being my choice) and reconstruct threads via another
(F9). Check the <a href=
"http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/mutt-notmuch.1.html">
manpage</a> for the 2-liner configuration snippet for your
<code>~/.muttrc</code>.</p>
<p>Arguably, some of the logics of mutt-notmuch could disappear by
adding support for a <code>--output=symlinks</code> flag to
Notmuch. A bug report requesting that is pending: too bad oversea
flights are not as good for accessing the Internet as they are for
perpetrating hacks!</p>
<h3>Download</h3>
<ul>
<li><a href=
"https://gitorious.org/mutt-notmuch/mutt-notmuch/blobs/raw/master/mutt-notmuch">
mutt-notmuch</a> - Notmuch (of a) helper for Mutt</li>
<li><a href=
"http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/mutt-notmuch.1">
mutt-notmuch.1</a> (<a href=
"http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/mutt-notmuch.1.html">html</a>)-
mutt-notmuch manpage</li>
</ul>
<hr />
<p><strong>Update</strong> 10/04/2011: mutt-notmuch code is now
available <a href="https://gitorious.org/mutt-notmuch">via Git</a>.
Resistence to propose your own patches is futile! The above link to
mutt-notmuch has been changed to point to the live Git version.</p>
<p><strong>Update</strong> 11/02/2012: Git repository has been
moved to Gitorious; links updated accordingly</p>
integrating Mutt with Org-modehttp://upsilon.cc/~zack/blog/posts/2010/02/integrating_Mutt_with_Org-mode/2013-10-17T07:38:11Z2010-02-08T14:09:41Z
<h1>remember Mutt's mail in Org-mode and jump back to them</h1>
<p>As <a href=
"http://upsilon.cc/~zack/blog/posts/2009/10/mail_indexing_for_mutt/">already
anticipated</a>, I've been implementing my own <a href=
"https://en.wikipedia.org/wiki/Getting%5FThings%5FDone">Getting
Things Done</a> work flow. This post documents one of its main
bricks: the <strong>integration between <a href=
"http://www.mutt.org/">Mutt</a> and <a href=
"http://orgmode.org">Org-mode</a></strong>.</p>
<p>As a geek, my main incoming stream of TODO items and information
in general is email. As emails hit my INBOX, I either deal with
them immediately (reply, archive, delete) or I need to store them
elsewhere, possibly adding extra information such as a deadline, a
personal note, the associated next action, the context in which it
is actionable, etc. This need of adding extra information is what
defeats the usage of my mail client (Mutt) as a list manager (in
the GTD sense), and that's where I plugged Org-mode in. My main
goals are:</p>
<ol>
<li>
<p><strong>create Org-mode notes from Mutt</strong>, referencing
the current email, and possibly inlining some of its metadata (e.g.
subject, sender)</p>
</li>
<li>
<p>quickly <strong>retrieve referenced emails from Org-mode
notes</strong>; ideally that should happen in my usual email
environment (i.e. Mutt), so that I can process the retrieved mail
as usual (e.g. to inform the sender that I did something about
it)</p>
</li>
</ol>
<p><small>In fact, both would be straightforward to achieve if I
were using some Emacs-based mail client such as <a href=
"http://www.gnus.org/">Gnus</a>, but <a href=
"http://upsilon.cc/~zack/blog/posts/2008/11/from_Vim_to_Emacs_-_part_2/">I resist the
<em>Emacs operating system syndrome</em></a>, and therefore I
insist in using my beloved Mutt.</small></p>
<p>Let's see how the two parts of the interaction between Mutt and
Org-mode work.</p>
<h2><small>(1)</small> Mutt → Org-mode <small><em>(there
...)</em></small></h2>
<p>The interaction from Mutt to Org-mode happens via <a href=
"http://orgmode.org/worg/org-contrib/org-protocol.php">org-protocol</a>.
Using it external applications can feed content to Org-mode note
templates, which are then interactively edited (via <a href=
"http://www.emacswiki.org/emacs/EmacsClient">emacsclient</a>), and
finally filed away.</p>
<p>The Mutt glue macro from my <code>~/.muttrc</code> is as
follow:</p>
<pre><code>macro index \eR "|~/bin/remember-mail\n"
</code></pre>
<p>The <a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=blob_plain;f=remember-mail;hb=HEAD">
remember-mail</a> script is trivial: it parses the fed mail from
STDIN (using a couple of legacy Perl modules) and then invokes
org-protocol.</p>
<p>The relevant configuration from my <code>~/.emacs</code> is
reported below (see the Git repo for the <a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=blob_plain;f=emacs-conf.sample;hb=HEAD">
most recent version of this</a>); the comments explain the various
parts:</p>
<pre><code>;; standard org <-> remember stuff, RTFM
(require 'org-capture)
(setq org-default-notes-file "~/org/gtd.org")
(setq org-capture-templates
(quote
(("m"
"Mail"
entry
(file+headline "~/org/gtd.org" "Incoming")
"* TODO %^{Title}\n\n Source: %u, %c\n\n %i"
:empty-lines 1)
;; ... more templates here ...
)))
;; ensure that emacsclient will show just the note to be edited when invoked
;; from Mutt, and that it will shut down emacsclient once finished;
;; fallback to legacy behavior when not invoked via org-protocol.
(add-hook 'org-capture-mode-hook 'delete-other-windows)
(setq my-org-protocol-flag nil)
(defadvice org-capture-finalize (after delete-frame-at-end activate)
"Delete frame at remember finalization"
(progn (if my-org-protocol-flag (delete-frame))
(setq my-org-protocol-flag nil)))
(defadvice org-capture-kill (after delete-frame-at-end activate)
"Delete frame at remember abort"
(progn (if my-org-protocol-flag (delete-frame))
(setq my-org-protocol-flag nil)))
(defadvice org-protocol-capture (before set-org-protocol-flag activate)
(setq my-org-protocol-flag t))
</code></pre>
<p>The result is that when you hit <code>ESC-R</code> in Mutt,
emacsclient will be fired up in place presenting a note template
that already contains relevant mail information (date, subject,
from) and lets you add extra information before going away.
Additionally, the email message-id will be hidden in the note as a
<code>mutt:</code> hyperlink with anchor text "mail".</p>
<h2><small>(2)</small> Org-mode → Mutt <small><em>(... and back
again)</em></small></h2>
<p>Going back means that clicking on a "mail" hyperlink within an
Org-mode note should bring up a Mutt instance showing the original
message, in its context (e.g. its own mailbox). Achieving that
consists of 2 separate steps:</p>
<ol>
<li>looking up a specific message by <code>Message-ID</code></li>
<li>firing up Mutt on the looked up message</li>
</ol>
<p>For the first part I use <a href=
"http://packages.debian.org/sid/notmuch%2Dmutt">notmuch-mutt</a>
(see this other <a href=
"http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/">blog
post</a> of mine).</p>
<p>For the second part I use the <a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=blob_plain;f=mutt-open;hb=HEAD">
mutt-open</a> script which fires upon a Mutt instance on the
maildir containing a specific message, and then "hits" the
appropriate keys to open the message and shutdown <a href=
"http://packages.debian.org/lenny/mutt-patched">the sidebar</a> (if
desired). It is a nicely reusable script, which I've being using
elsewhere too.</p>
<p>The needed glue on the emacs side is just a function to invoke
<code>mutt-open</code> in a brand new terminal, and its declaration
as the handler for <code>mutt:</code> URLs.</p>
<pre><code>(defun open-mail-in-mutt (message)
"Open a mail message in Mutt, using an external terminal.
Message can be specified either by a path pointing inside a
Maildir, or by Message-ID."
(interactive "MPath or Message-ID: ")
(shell-command
(format "gnome-terminal -e \"%s %s\""
(substitute-in-file-name "$HOME/bin/mutt-open") message)))
;; add support for "mutt:ID" links
(org-add-link-type "mutt" 'open-mail-in-mutt)
</code></pre>
<p>Voilà!</p>
<h2>Download</h2>
<p>Scripts and configuration snippets discussed above are available
from the <a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=summary">org-mutt
Git repository</a>:</p>
<ul>
<li><a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=blob_plain;f=remember-mail;hb=HEAD">
remember-mail</a> - store in Org-mode a note back-referencing an
email</li>
<li><a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=blob_plain;f=mutt-open;hb=HEAD">
mutt-open</a> - open Mutt on an email having a specific
<code>Message-ID</code></li>
<li><a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=blob_plain;f=emacs-conf.sample;hb=HEAD">
Emacs configuration</a></li>
<li><a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=blob_plain;f=mutt-conf.sample;hb=HEAD">
Mutt configuration</a></li>
</ul>
<hr />
<p><strong>Update 22/01/2011:</strong> fix mutt-open to work with
maildir-utils, version 7 or above<br />
<strong>Update 17/02/2012:</strong> move scripts and conf to the
<a href=
"http://git.upsilon.cc/?p=utils/org-mutt.git;a=summary">org-mutt
Git repo</a><br />
<strong>Update 17/10/2013:</strong> point to notmuch-mutt blog
post, getting rid of mu<br />
<strong>Update 17/10/2013:</strong> update Emacs conf snippet for
Org >= 0.8 (see Git repo)<br /></p>
mail indexing for mutthttp://upsilon.cc/~zack/blog/posts/2009/10/mail_indexing_for_mutt/2011-02-03T18:09:42Z2009-10-31T14:11:00Z
<h1>a tale of three tools: mairix, maildir-utils (mu), nmzmail</h1>
<p>I think/fear I'm getting into this <a href=
"https://en.wikipedia.org/wiki/Getting%5FThings%5FDone">Getting
Things Done</a> thingie. For weird reasons I'll explain later on,
part of the GTD work flow I'm implementing requires quick
<strong>lookup from Message-IDs to the corresponding mail</strong>,
no matter in which mailbox (actually Maildir) I've stored it.</p>
<p>Hence, I've looked for a mail indexing tool which is
<strong>Mutt-compatible</strong>, <strong>handles
Maildirs</strong>, and supports Message-ID queries. In Debian
(where else should I look? <em>g</em>), I found three: <a href=
"http://packages.debian.org/sid/mairix">mairix</a>, <a href=
"http://packages.debian.org/sid/nmzmail">nmzmail</a>, <a href=
"http://packages.debian.org/sid/maildir%2Dutils">maildir-utils</a>
(whose upstream name is actually "mu").</p>
<p>The first one I tried is <a href=
"http://www.rpcurnow.force9.co.uk/mairix/"><strong>mairix</strong></a>.
Last upload in Debian was 2 years ago, it doesn't seem to be
particularly buggy, and in popcon it has about 300 installations.
The integration with mutt is good: searches can create a sort of
virtual Maildir, whose files are symlink to the search results;
with a couple of macros you can have Mutt easily open the result
directory after query. The reason why I ditched mairix, is that it
heavily suffer from the <strong><a href=
"https://en.wikipedia.org/wiki/NIH%5Fsyndrome">NIH
syndrome</a></strong>. mairix is a self-contained executable with
no external dependencies; that in principle being good, I found
nowadays totally unreasonable to not use some third party full text
search indexer, given that in the FOSS world we have several good
ones. A good aspect of mairix, which is missing in the competitors,
is the ability to index messages incrementally as they flow in,
e.g. via procmail. Still, the problem of that is that it is
difficult to pair that with the habit of moving messages across
mailboxes. To that end, periodic re-indexing, or better batch index
updates, offers a better work flow.</p>
<p>Then I tried <a href=
"http://www.ecademix.com/JohannesHofmann/nmzmail.html"><strong>nmzmail</strong></a>,
which claims at is killer feature the "better integration with
Mutt" wrt competitors. Actually, this is false, it has the same
level of integration of the other (virtual maildirs with macros)
and <a href=
"http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=552731">it
doesn't even offer</a> a ready to use set of macros in the doc!
(yeah, they're easy to write, but given that you claim you're so
well integrated with Mutt ...). The reason why I ditched nmzmail is
that I didn't particularly like its choice of (external at least)
indexer: Namazu. The <strong>index</strong> it created <strong>was
very big</strong> (something like 250 Mb for about 400 Mb of
Maildirs). Also, I had a bad feeling that the indexing was somehow
<strong>Japanese-specific</strong> (the project having support for
that language) and I found no way to disable support for that,
which I obviously do not need.</p>
<p>Finally, I tried <a href=
"http://code.google.com/p/mu0/"><strong>maildir-utils</strong></a>
and I was finally happy. It is implemented on top of <a href=
"http://www.sqlite.org/">Sqlite3</a> (for mail metadata) and
<a href="http://xapian.org/">Xapian</a> (for full-text indexing).
There are some bugs, but Norbert, as the very reactive maintainer,
have tackled down most of them now and I've been happy to help with
various feedback. Integration with Mutt is granted by the following
2 macros:</p>
<pre><code> macro index <F8> "<shell-escape>rm -rf ~/.mu/results; mu-find -o l -l ~/.mu/results " "mu-find"
macro index <F9> "<change-folder-readonly>~/.mu/results\n" "display mu-find results"
</code></pre>
<p>The first one query (you) for the search string, the second
jumps to the results opening the virtual Maildir (which is useful,
especially when you want to go back to the last query you did). I
update the index every two hour with the following cron entry:</p>
<pre><code> 31 */2 * * * on_ac_power && mu-index -q
</code></pre>
<p>Beside <a href=
"http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=535162">a corner
case bug which is close to solution</a>, updating the index is very
fast, usually a few seconds; index size is about 150 Mb. To
conclude, my initial goal (message path lookup via Message-ID) is
easily achieved as follows:</p>
<pre><code> $ mu-find -f P m:20091030112543.GA4230@usha.takhisis.invalid
/home/zack/Maildir/INBOX/cur/1256902638_0.25702.usha,U=37563,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
</code></pre>
<p>In addition to that, I've now gained all-maildirs full-text
search from within Mutt <img src="http://upsilon.cc/~zack/smileys/smile.png" alt=
":-)" /></p>
<p>As a concluding remark, <a href=
"http://www.enricozini.org/blog/pdo/">Enrico</a> pointed me to
<a href="http://notmuchmail.org/"><strong>Not much
mail</strong></a>, but it seems to be (by authors' own admission)
in early stage of development. Also, AFAIU it aims to be a
<acronym title="Mail User Agent">MUA</acronym>, whereas I'm
perfectly fine with Mutt, I just need from time to time to
integrate it with other components of my daily work flow.</p>
<p><strong>Update:</strong> (30/01/2011) I've now tried Notmuch and
switched to it without looking back. I've written about it in a
<a href=
"http://upsilon.cc/~zack/blog/posts/2011/01/how_to_use_Notmuch_with_Mutt/">separate
post</a>, including tips on how to integrate Notmuch with Mutt.</p>
mutt patched key bindingshttp://upsilon.cc/~zack/blog/posts/2008/01/mutt_patched_key_bindings/2009-11-28T12:00:16Z2008-01-13T09:44:53Z
<h1>mutt-patched: sidebar keybindings</h1>
<p><a href=
"http://packages.debian.org/mutt%2Dpatched">mutt-patched</a> it's
really cool, <a href=
"http://www.df7cb.de/blog/2008/mutt-patched.html">thanks Myon for
advertising it</a>. Actually I've tried it only in the hope that it
could solve <a href="http://bugs.debian.org/459739">Debian bug
#459739</a> (don't bother trying: it doesn't), but I'm now liking
it, especially the <a href=
"http://www.lunar-linux.org/index.php?option=com_content&task=view&id=44">
sidebar patch</a>.</p>
<p>Unfortunately it lacks default keybindings for moving the
sidebar cursor (why the heck: since the sidebar is enabled by
default, am I supposed only to <em>look</em> at it?). Here are
mine, in case someone wants a "plug and play" configuration for her
<code>.muttrc</code>:</p>
<pre><code>zack@aquarium:~$ cat .muttrc |tail -n 6
# mutt sidebar settings
bind index,pager \CP sidebar-prev
bind index,pager \CN sidebar-next
bind index,pager \CO sidebar-open
macro index,pager B '<enter-command>toggle sidebar_visible<enter>'
color sidebar_new yellow default
</code></pre>
<p>They are basically a subset of those proposed on <a href=
"http://www.lunar-linux.org/index.php?option=com_content&task=view&id=44">
the homepage</a>, but I did not like changing the default semantics
of <code>b</code>. See also <a href=
"http://bugs.debian.org/459725">Debian bug #459725</a>.</p>