Set Up Address Book Integration#
Prerequisites#
Confirm NeoMutt is working and you can open a mailbox.
Decide which address source you want to use: aliases, abook, khard, LDAP, or a custom query script.
Using NeoMutt’s Built-In Alias System#
Add aliases to a config file that is sourced:
alias alan Alan Jones <alan@example.com> # tags:friends
alias briony Briony Williams <bw@example.com> # tags:friends
(Optional) Store aliases in a separate file and source it:
source ~/.mail_aliases
set alias_file=~/.mail_aliases
At an address prompt, press Tab to expand an alias or list matches.
Expected result: aliases expand at To: and Cc: prompts, and the alias menu appears if there are multiple matches.
Integrating with abook#
Install and configure abook (see its documentation).
Configure NeoMutt to query abook:
set query_command = "abook --mutt-query %s"
In the index menu, press Q to query addresses.
Expected result: the query menu lists contacts returned by abook.
References: abook man page and project docs.
Integrating with khard (CardDAV)#
Install and configure khard and its address book backend (see khard docs).
Configure NeoMutt to query khard:
set query_command = "khard email --parsable %s"
Press Q in the index menu or Ctrl-T at an address prompt to query.
Expected result: the query menu lists khard results and address completion works.
References: khard scripting docs.
Using query_command for External Lookups#
Create or install a query wrapper script.
Point NeoMutt at it:
set query_command = "mutt_ldap_query.pl %s"
Use Q in the index menu to run a query.
Expected result: a query menu with matching results and selectable addresses.
Using LDAP for Address Lookups#
Install or configure an LDAP query wrapper script (for example
mutt_ldap_query.pl).Set
query_commandto that script.Use Q to search and select results.
Expected result: LDAP results appear in the query menu and can be inserted into address fields.
Auto-Saving Addresses from Received Mail#
Decide where you want to store new contacts.
Add a macro to pipe a message to your address tool:
macro index,pager A "<pipe-message>abook --add-email-quiet<Enter>" "Save sender to abook"
Open a message and press A.
Expected result: the sender is added to your address book.
Adjust the command to match your tool (abook, khard, or a custom script).
Configuring Tab Completion for Addresses#
Use aliases or an external query source.
At any address prompt, press Tab to expand or list matches.
Use Ctrl-T to query external address sources if configured.
Expected result: you can complete addresses quickly without leaving the prompt.