External Address Queries#
Setting Up the Query Command#
NeoMutt supports connecting to external directory databases such as LDAP, ph/qi, bbdb, or NIS through a wrapper script which connects to NeoMutt using a simple interface.
Using the $query_command variable, you specify the wrapper command to use.
For example:
set query_command = "mutt_ldap_query.pl %s"
Wrapper Script Requirements#
The wrapper script should accept the query on the command-line. It should return a one line message, then each matching response on a single line, each line containing a tab separated address then name then some other optional information. On error, or if there are no matching addresses, return a non-zero exit code and a one line error message.
An example multiple response output:
Searching database ... 70 entries ... 5 matching:
ji@papaya.com Jeremy Irons Emmy, Oscar, Tony
jc@damson.com James Cagney Oscar
mr@ilama.com Meg Ryan
mjf@kumquat.com Michael J Fox
ma@yew.com Murray Abraham Oscar
Using Address Queries#
There are two mechanisms for accessing the query function of NeoMutt.
Address Completion at Prompts#
In any prompt for address entry, use the
<complete-query>function (default: ^T) to run a query based on the current address you have typed.Like aliases, NeoMutt will look for what you have typed back to the last space or comma.
If there is a single response for that query, NeoMutt will expand the address in place.
If there are multiple responses, NeoMutt will activate the query menu. At the query menu, you can select one or more addresses to be added to the prompt.
Note
The query menu is affected by $alias_sort, thus overruling the order of entries as generated by $query_command.