Enterprise Software

Use lbdb to combine contact sources for easy address lookup

Vincent Danen describes a handy little tool that makes it easy to search for addresses outside of your e-mail client. See what the Little Brother's Database (lbdb) can do for you.

Address book storage varies by e-mail client; many keep contacts in their own storage format that makes them inaccessible to other clients. One program, called the Little Brother's Database, can bring many of these together to make it easy to search for contacts outside of your e-mail client.

Little Brother's Database (lbdb) can be downloaded from its home page. Primarily, it was written to make various address sources available to Emacs mailers and Mutt, but it can be used as a standalone query client as well.

It supports a variety of different address sources, including the passwd file, YP/NIS, LDAP, PGP/GnuPG keyrings, the Mutt aliases file, the Pine address book, GnomeCard, the Palm address database (if you sync your Palm address book to your desktop using a program such as jPilot), Evolution, and vCard files. If you run lbdb on Mac OS X, you can even search the OS X Address Book.

To begin, download and untar the file to compile it; some distributions may come with lbdb included or in a third-party repository. Use various —with commands to add support for address sources you like (most get included by default, but not all):

$ cd lbdb-0.34
$ ./configure —prefix=/usr/local —with-gpg \
—with-evolution-addressbook-export —with-niscat
$ make
$ sudo make install

This will install lbdb into /usr/local/. Then edit ~/.lbdbrc and change the METHODS keyword to include support for the lookup methods you want to use:

METHODS="m_muttalias m_evolution m_ldap m_gpg"

This will perform lookups via Mutt's aliases file, Evolution's address book, LDAP, and GnuPG. You'll also want to go through the sample lbdb.rc file to configure the various modules, which typically sets paths to various data sources.

The /usr/local/bin/lbdbq program does the actual lookups. To search for an address, use:

$ /usr/local/bin/lbdbq joe@joe.com
lbdbq: 1 matches
joe@joe.com      Joe User   (GnuPG)

Although lbdb is a small program, its ability to combine disparate address sources may be welcome to many users.

Delivered each Tuesday, TechRepublic's free Linux NetNote provides tips, articles, and other resources to help you hone your Linux skills. Automatically sign up today!

About Vincent Danen

Vincent Danen works on the Red Hat Security Response Team and lives in Canada. He has been writing about and developing on Linux for over 10 years and is a veteran Mac user.

Editor's Picks

Free Newsletters, In your Inbox