next up previous contents
Next: Querying an LDAP Server Up: Configuring Your Address Book Previous: Alias File   Contents


Abook

Abook is a simple console address book that stores all your information in text files and interfaces well with mutt. Written by Jaakko Heinonen, it is undergoing active development as of September 2006. Abook is easy to configure and use. It does not, however, understand the vcard standard file format: this is its most serious limitation. Also, in earlier versions, abook ran parallel to your alias file and you had to manually syncronize them every so often, which was not very convenient; fortunately, that has been dealt with, and these days, for a decent address book and an easy interface with mutt, abook is hard to beat.

To use abook, first download and install it (see section 5.2 for the link), and get familiar with how it works by running it from a console. It's pretty straightforward, and you can either type in a couple of addresses to practice with or import your mutt alias file. Now that you've got some addresses to work with, integrate it with mutt.

The first step is to remove the links to the mutt alias file, so assuming you called your alias file .mutt-alias, make sure to remove the following two lines from your .muttrc:

set alias_file=".mutt-alias"
source .mutt-alias

And now add the following two lines in their place:

set query_command= "abook --mutt-query '%s'"
macro index,pager A "<pipe-message>abook --add-email-quiet<return>" 
             "add the sender address to abook"

The first line sets up the link to abook for extracting addresses from your addressbook, and the second one creates a macro so that when you press 'A' just about anywhere, the email address of that message's sender will be sent to abook.

Lastly, get used to using "query" functionality instead of alias functionality, as mutt treats them differently. Let's say you start a new message by pressing 'm' in the index view. Mutt presents you with "To: " and waits for you to enter the address of your recipient. Normally you'd press tab at this point for a quick search of the aliases in your alias file. Instead, now you press Control-T in order to do the same thing, but via a query to abook instead of your alias file. Put the cursor over the person you'd like to write and press enter to start the message. If you'd like to several people from the abook, tag them using the 't' key and then press ;m to have them all placed on the "To:" line of your message. You can add additional queries to the same line by pressing 'A.'

For example, type Control-t to start a query, "Do" to search for names that start with "Do." You select a few by pressing 't' and then press 'A' to search for additional names using a different criteria. Press "Ri" to search for names that start with "Ri" and select them in the same way. When you've tagged everyone you'd like to mail, press ";m" to send all those addresses to the "To: " line. Repeat this process for the "Cc: " line and so on.

Some people like to use the abook and the alias file in parallel, keeping good/important addresses in the abook and using the alias file to collect addresses from mail they read. This is a bit inelegant since it forces you to manually synchronize from time to time, but has its advantages, since, for one, the alias file allows you to include a mailing list composed of other names present in the alias file, while abook does not. Nothing is simple, but take a look at http://wolfermann.org/abook-autoexport for one way of doing so.


next up previous contents
Next: Querying an LDAP Server Up: Configuring Your Address Book Previous: Alias File   Contents
Randall Wood 2009-12-02