Switch to unified view

a b/website/faqsandhowtos/MuttAndRecoll.txt
1
== Interfacing Recoll and Mutt
2
3
It is possible to either use Mutt as a Recoll search result viewer, or
4
start Recoll from the Mutt search.
5
6
=== Starting Mutt to view Recoll search results
7
8
This method and the associated 
9
link:http://www.recoll.org/files/recoll2mutt[recoll2mutt script] were kindly
10
contributed by Morten Langlo.
11
12
This allows finding mail messages in recoll and then calling *mutt*
13
or *mutt-kz* to read or process the mail. 
14
15
Installation:
16
17
- Copy the [[http://www.recoll.org/files/recoll2mutt|recoll2mutt script]]
18
  somewhere in your PATH, and make it executable.
19
- In the **recoll** GUI menus: 
20
_Preferences->GUI configuration->User interface->Choose editor applications_
21
change the entry for "message/rfc822" to: +recoll2mutt %f+
22
23
The script has options for setting a number of parameters, you may not need
24
to set any of them, the defaults are:
25
26
- -c mutt
27
- -F .muttrc
28
- -m Mail
29
- -x "-fn 10*20 -geometry 115x40"
30
31
Example:
32
33
----
34
recoll2mutt -c mutt-kz -F .mutt_kzrc -m Mail -x "-fn 10*20 -geometry 115x40"  %f
35
----
36
37
The option +-x+ is passed to *xterm*, which is used to call *mutt* or
38
*mutt-kz*.
39
40
The script works for both _mbox_ and _maildir_ mail boxes, and it
41
expects the configuration file for mutt and the mail directory to reside in
42
your $HOME and the spool file to be '/var/spool/mail/$USER' if it is
43
not in your mail directory. But it is easy to change the values in the
44
script if you need to.
45
46
*mutt* is opened with the right mailbox and limit set to _Date_ and
47
_Sender_.  In theory you could set limit to _Message-Id_, but very often
48
*mutt* reports, that there are invalid patterns in _Message-Id_, so do it
49
safe, even though all emails in the opened mail box with the same date from
50
the sender are shown.
51
52
53
=== Starting Recoll from the Mutt search
54
55
This will work only when using maildir storage (messages in individual
56
files). It will not work with mailbox files. The latter would probably be
57
possible by extracting the individual result messages using the Python
58
interface, but I did not try.
59
60
The classic way to interface Mutt and a search application is to create a
61
shortcut to an external command which creates a temporary Maildir
62
containing the search results.
63
64
There is such a script for Recoll, you will find it link:https://bitbucket.org/medoc/recoll/raw/41d41799dbac4c69a34db985b3ab9f1597c9c742/src/python/samples/mutt-recoll.py[here].
65
66
Copy the script somewhere in your PATH, and make it executable, then add
67
the following line to your '.muttrc':
68
69
70
----
71
72
macro index S "<enter-command>unset wait_key<enter><shell-escape>mutt-recoll.py -G<enter><change-folder-readonly>~/.cache/mutt_results<enter>" \
73
          "search mail (using recoll)"
74
75
----
76
77
Obviously, you can replace the 'S' letter with whatever will suit you (e.g:/)