Under Development
stars

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.

From the Index Menu#

  1. Use the <query> function (default: Q) from the index menu.

  2. This will prompt for a query, then bring up the query menu which will list the matching responses.

  3. From the query menu, you can select addresses to create aliases, or to mail.

  4. You can tag multiple addresses to mail, start a new query, or have a new query appended to the current responses.

πŸ“· Screenshot Needed

Subject: Query results menu

Description: The NeoMutt query menu after executing an address query, showing a list of matching contacts with columns for email address, real name, and optional extra information (e.g. organisation). One or more entries should be tagged with * to illustrate multi-selection.

Highlights: The tabular layout of query results, how to tag entries for selection, and the status bar showing the query string used.

Address Completion at Prompts#

  1. 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.

  2. Like aliases, NeoMutt will look for what you have typed back to the last space or comma.

  3. If there is a single response for that query, NeoMutt will expand the address in place.

  4. 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.