Merge remote-tracking branch 'wberrier/master'
[mutt-ldap.git] / README
1 Mutt-LDAP provides an `external address query script`_ for Mutt_ which
2 connects to LDAP_ databases using python-ldap_.  It can cache queries
3 locally in case your LDAP server is slow or not always available,
4 expiring cached queries after a configurable amount of time.
5
6 Installation
7 ============
8
9 Packages
10 --------
11
12 Gentoo
13 ~~~~~~
14
15 I've packaged Mutt-LDAP for Gentoo_.  You need layman_ and my `wtk
16 overlay`_.  Install with::
17
18   # emerge -av app-portage/layman
19   # layman --add wtk
20   # emerge -av mail-client/mutt-ldap
21
22 Dependencies
23 ------------
24
25 If you're installing by hand or packaging Mutt-LDAP for another
26 distribution, you'll need the following dependencies:
27
28 ============  ====================  ===========  ======================
29 Package       Purpose               Debian_      Gentoo_
30 ============  ====================  ===========  ======================
31 python-ldap_  LDAP connections      python-ldap  dev-python/python-ldap
32 PyXDG_        Optional XDG support  python-xdg   dev-python/pyxdg
33 ============  ====================  ===========  ======================
34
35 Installing by hand
36 ------------------
37
38 Mutt-LDAP is available as a Git_ repository::
39
40   $ git clone git://tremily.us/mutt-ldap.git
41
42 It is also mirrored on GitHub_.  To install the checkout, run the
43 standard::
44
45   $ python setup.py install
46
47 or you can just copy ``mutt_ldap.py`` into to your ``PATH``.
48
49 Usage
50 =====
51
52 Add the following line to your ``~/.muttrc``::
53
54   set query_command = "mutt_ldap.py '%s'"
55
56 Search for addresses (from Mutt_) with ``^t``, optionally after typing
57 part of the name.  Configure your connection by creating
58 ``$XDG_CONFIG_HOME/mutt-ldap.cfg`` containing something like::
59
60   [connection]
61   server = myserver.example.net
62   basedn = ou=people,dc=example,dc=net
63
64 The query cache (enabled by default) will be created at
65 ``$XDG_DATA_HOME/mutt-ldap.json``, unless overriden by an explicit
66 ``cache.path`` setting.
67
68 See the ``CONFIG`` options in ``mutt_ldap.py`` for other available
69 settings.  See the `XDG Base Directory Specification`_ for more
70 details on configuration and cache file locations.  If the ``xdg``
71 module supplied by PyXDG_ is not available, the default configuration
72 path falls back on ``~/.config/mutt-ldap.cfg`` and the default cache
73 path falls back on ``~/.cache/mutt-ldap.json``.
74
75 Licence
76 =======
77
78 This project is distributed under the `GNU General Public License
79 Version 3`_ or greater.
80
81 Bugs
82 ====
83
84 Use the `GitHub issue tracker`_ to submit bugs.
85
86 Related work
87 ============
88
89 `mutt_ldap_query`_ is a Perl script with a similar purpose.
90
91 .. _external address query script:
92    http://www.mutt.org/doc/manual/manual-4.html#ss4.5
93 .. _Mutt: http://www.mutt.org/
94 .. _LDAP: http://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol
95 .. _python-ldap: http://www.python-ldap.org/
96 .. _Gentoo: http://www.gentoo.org/
97 .. _layman: http://layman.sourceforge.net/
98 .. _wtk overlay: http://blog.tremily.us/posts/Gentoo_overlay/
99 .. _Debian: http://www.debian.org/
100 .. _PyXDG: http://freedesktop.org/wiki/Software/pyxdg
101 .. _Git: http://git-scm.com/
102 .. _XDG Base Directory Specification:
103    http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
104 .. _GNU General Public License Version 3: http://www.gnu.org/licenses/gpl.html
105 .. _GitHub: https://github.com/wking/mutt-ldap
106 .. _GitHub issue tracker: https://github.com/wking/mutt-ldap/issues
107 .. _mutt_ldap_query: ftp://ftp.mutt.org/pub/mutt/contrib/mutt_ldap_query.README