LBDBQ(1)

LBDBQ πŸ’– (the query program for the little brother's database)

okay bestie, this is the manual page for lbdbq β€” it lives in the User Manuals section of the man pages, and it's genuinely iconic. buckle up. πŸŽ€


✨ NAME ✨

lbdbq β€” the query program for the little brother's database 🫢


✨ SYNOPSIS ✨

lbdbq something
lbdbq [-v|--version|-h|--help]

like. two whole moods. you're either asking it for something or you're asking it who it is. πŸ’…


✨ DESCRIPTION ✨

so lbdbq is the client program for the little brother's database. its whole thing is that it tries to invoke a bunch of modules to gather info about people matching something. like, it might peek at a list of addresses you've gotten mail from, or it might look at YP maps, or it might literally try to finger something@<various hosts>. no cap, it's doing the most and we love that for it. πŸ’–

the behavior is configurable: when it starts up, lbdbq will source these shell scripts:

/etc/lbdb.rc
$XDG_CONFIG_HOME/lbdb/config
$HOME/.lbdbrc
$HOME/.lbdb/lbdbrc
$HOME/.lbdb/rc

β€” but only if they exist. if they don't exist? it's not gonna stress about it. πŸ™ˆ

you can use those files to set the following global variables:

  • MODULES_PATH β€” a space separated list of directories, where lbdbq should look for modules. πŸ“‚
  • METHODS β€” a space separated list of the modules to use.
  • SORT_OUTPUT β€” okay this one has lore. if you set it to false or no, lbdbq won't sort the addresses, but returns them in reverse order (which means the most recent address in the m_inmail database is first). if you set it to name, lbdbq sorts the output by real name. if you set it to comment, it sorts the output by the comment (for example the date in m_inmail). reverse_comment does the same thing as comment, but in reverse order, so the most recent timestamp of m_inmail may be on top. and if you set SORT_OUTPUT to address, lbdbq sorts the output by addresses β€” and that's the default, fyi. πŸ‘‘
  • KEEP_DUPES β€” if you set this to true or yes, lbdbq won't remove duplicate addresses that have different real name comment fields. it said "let them all in, they're valid." πŸ’…
⚠️ heads up bestie: there are defaults, so you should most probably modify these variables using constructs like this:
MODULES_PATH="$MODULES_PATH $HOME/lbdb_modules"

also, modules can have configuration variables of their own. little guys with their own little settings. so cute. πŸŽ€


✨ MODULES ✨

currently, the following modules are supplied with lbdb. there are a LOT of them and honestly? each one ate. πŸ”₯

  • m_finger β€” this module will use finger to find out something more about a person. the list of hosts to be asked is configurable; use the M_FINGER_HOSTS variable. note that "localhost" will mean an invocation of your local finger(1) binary, and should thus work even if you don't provide the finger service to the network. m_finger tries to find out the machine's mail domain name in /etc/mailname, by parsing a sendmail.cf file (if it finds one) and by reading /etc/hostname and /etc/HOSTNAME. if you know that this fails on your machine, or you want to force lbdbq to consider some other name to be the local mail domain name (misconfigured SUNs come to mind here 😭), you can specify a name using the MAIL_DOMAIN_NAME variable. if this variable is set by you, no probing will be done by lbdbq. periodt.
  • m_inmail β€” this module will look up user name fragments in a list of mail addresses created by lbdb-fetchaddr(1). by default this uses $XDG_DATA_HOME/lbdb/m_inmail.db, which is overridden if $HOME/.lbdb/m_inmail.utf-8 exists (the old default) as its database file β€” but this can be changed using the INMAIL_DB variable (but do not forget to change this in the lbdb-fetchaddr(1) call using option -f, too, bestie, or they'll be beefing). 🫢
  • m_passwd β€” this module searches for matching entries in your local /etc/passwd file. it evaluates the local machine mail domain in the same way m_finger does. if you set PASSWD_IGNORESYS=true, this module ignores all system accounts and only finds UIDs between 1000 and 29999 (all other UIDs are reserved on a Debian system). gatekeeping the system accounts, honestly valid. πŸ’…
  • m_yppasswd β€” this module searches for matching entries in the NIS password database using the command ypcat passwd. πŸ¦‹
  • m_nispasswd β€” this module searches for matching entries in the NIS+ password database using the command niscat passwd.org_dir.
  • m_getent β€” this module searches for matching entries in whatever password database is configured using the command getent passwd. flexible icon.
  • m_pgp2, m_pgp5, m_gpg β€” these modules scan your PGP 2., PGP 5. or GnuPG public key ring for data. they use the programs pgp(1), pgpk(1), or gpg(1) to get the data. the whole crypto crew showed up. πŸ”
  • m_fido β€” this module searches your Fido nodelist, stored in $HOME/.lbdb/nodelist created by nodelist2lbdb(1).
  • m_abook β€” this module uses the program abook(1), a text based address book application, to search for addresses. you can define multiple abook address books by setting the variable ABOOK_FILES to a space separated list. πŸ“
  • m_goobook β€” this module uses the program goobook(1), a tool to access Google contacts via command line.
  • m_addr_email β€” this module uses the program addr-email(1), a text based frontend to the Tk addressbook(1) application.
  • m_muttalias β€” this module searches the variable MUTTALIAS_FILES (a space separated list) of files in MUTT_DIRECTORY that contain mutt aliases. file names without a leading slash will have MUTT_DIRECTORY (which defaults to $HOME/.mutt, or $HOME if $HOME/.mutt does not exist) prepended before the file name. absolute file names (beginning with /) will be taken direct. no editing required. ✨
  • m_pine β€” this module searches pine(1) addressbook files for aliases. to realize this it first inspects the variable PINERC. if it isn't set, the default `/etc/pine.conf /etc/pine.conf.fixed .pinerc' is used. to suppress inspecting the PINERC variable, set it to no. it then takes all address-book and global-address-book entries from these pinerc files and adds the contents of the variable PINE_ADDRESSBOOKS to the list, which defaults to `/etc/addressbook .addressbook'. then these addressbooks are searched for aliases. all filenames without a leading slash are searched in $HOME.
  • m_palm β€” this module searches the Palm address database using the Palm::PDB(3pm) and Palm::Address(3pm) Perl modules from CPAN. it searches in the variable PALM_ADDRESS_DATABASE or, if this isn't set, in $HOME/.jpilot/AddressDB.pdb. 🌴
  • m_gnomecard β€” this module searches for addresses in your GnomeCard database files. the variable GNOMECARD_FILES is a whitespace separated list of GnomeCard data files. if this variable isn't defined, the module searches in $HOME/.gnome/GnomeCard for the GnomeCard database or at least falls back to $HOME/.gnome/GnomeCard.gcrd. if a filename does not start with a slash, it is prefixed with $HOME/. 🧚
  • m_bbdb β€” this module searches for addresses in your (X)Emacs BBDB (big brother database). it doesn't access ~/.bbdb directly (yet) but calls emacs(1) or xemacs(1) with a special mode to get the information β€” so don't expect too much performance in this module, bestie. 😭 you can configure the EMACS variable to tell this module which emacsen to use. otherwise it will fall back to emacs or xemacs. the drama of it all.
  • m_ldap β€” this module queries an LDAP server using the Net::LDAP(3pm) Perl modules from CPAN. it can be configured using an external resource file /etc/lbdb_ldap.rc or $XDG_CONFIG_HOME/lbdb/ldap.rc or $HOME/.lbdb/ldap.rc or $HOME/.mutt_ldap_query.rc. you can explicitly define a LDAP query in this file, or you can use one or more of the predefined queries from the %ldap_server_db in this file. for this you have to define a space separated list of nicknames from entries in the variable LDAP_NICKS.
  • m_wanderlust β€” this module searches for addresses stored in your $WANDERLUST_ADDRESSES (or by default in $HOME/.addresses) file, an addressbook of WanderLust. 🌈
  • m_osx_addressbook β€” this module queries the OS X AddressBook. it is only available on OS X systems. sorry to everyone else, it's exclusive. πŸ’…
  • m_evolution β€” this module queries the Ximian Evolution address book. it depends on the program evolution-addressbook-export, which is shipped with evolution.
  • m_vcf β€” this module uses a bundled little perl program named vcquery to search for addresses from the space-separated set of vCard files defined in $VCF_FILES. a whole little guy in there. πŸŽ€
  • m_khard β€” this module searches a CardDAV address book via khard(1).
  • m_mu β€” this module uses the program mu-cfind(1), which searches in the index file generated by the mu tool. you can filter the results with the variables MU_AFTER (the number of seconds since 1970-01-01 UTC) and MU_PERSONAL (set to true or yes, and remember to invoke mu-index(1) with --my-address). 🫢
  • m_notmuch_addrlookup β€” this module uses the program notmuch-addrlookup(1), which searches the notmuch(1) index for mail addresses.

feel free to create your own modules to query other database resources, YP maps, and the like. m_finger should be a good example of how to do it. go off, build your own. πŸ”₯

if you create your own modules or have other changes and feel that they could be helpful for others, don't hesitate to submit them to the author for inclusion in later releases. sharing is caring, bestie. 🫢

finally, to use lbdbq from mutt, add the following line to your $HOME/.muttrc:

set query_command="lbdbq %s"

✨ OPTIONS ✨

  • -v | --version β€” print the version number of lbdbq. like "who even are you." πŸ‘‘
  • -h | --help β€” print short help of lbdbq. your little cheat sheet. πŸŽ€

✨ FILES ✨

  • /etc/lbdb.rc
  • $XDG_CONFIG_HOME/lbdb/config
  • $HOME/.lbdbrc
  • $HOME/.lbdb/lbdbrc
  • $HOME/.lbdb/rc
  • /usr/libexec/lbdb/*
  • $XDG_DATA_HOME/lbdb/m_inmail.db
  • $HOME/.lbdb/m_inmail.utf-8
  • $HOME/.lbdb/nodelist

✨ SEE ALSO ✨

finger(1), ypcat(1), niscat(1), getent(1), pgp(1), pgpk(1), gpg(1), lbdb-fetchaddr(1), nodelist2lbdb(1), mutt_ldap_query(1), abook(1), goobook(1), addr-email(1), addressbook(1), mutt(1), pine(1), emacs(1), xemacs(1), Palm::PDB(3pm), Palm::Address(3pm), Net::LDAP(3pm), khard(1), mu-cfind(1), notmuch-addrlookup(1)

the whole squad is linked in. iykyk. πŸ’–

πŸ’– CREDITS πŸ’–

Okay bestie, storytime: most of the genuinely interesting code in this program β€” namely the RFC 822 address parser that lbdb-fetchaddr uses β€” was stolen from Michael Elkins' mutt mail user agent. Iconic behaviour honestly. Extra credits go to Brandon Long for dropping the query functionality into mutt. πŸ‘‘

And a huge slay to everyone who wrote the modules and extensions, because they ate and left no crumbs:

  • Ross Campbell <rcampbel@us.oracle.com> β€” m_abook, m_yppasswd πŸŽ€
  • Marc de Courville <marc@courville.org> β€” m_ldap, mutt_ldap_query ✨
  • Brendan Cully <brendan@kublai.com> β€” m_osx_addressbook, m_vcf πŸ¦‹
  • Gabor Fleischer <flocsy@mtesz.hu> β€” m_pine 🌸
  • Rick Frankel <rick@rickster.com> β€” m_gnomecard 🌈
  • Utz-Uwe Haus <haus@uuhaus.de> β€” m_bbdb, m_nispasswd ⭐
  • Torsten Jerzembeck <toje@nightingale.ms.sub.org> β€” m_addr_email πŸ’œ
  • Adrian Likins <alikins@redhat.com> β€” m_getent πŸ”₯
  • Gergely Nagy <algernon@debian.org> β€” m_wanderlust 🧚
  • Dave Pearson <davep@davep.org> β€” m_palm, lbdb.el πŸ“
  • Brian Salter-Duke <b_duke@bigpond.net.au> β€” m_muttalias πŸ’…
  • FranΓ§ois Charlier <fcharlier@ploup.net> β€” m_goobook 😭
  • Colin Watson <cjwatson@debian.org> β€” m_khard πŸ’–
  • gregor herrmann <gregoa@debian.org> β€” m_notmuch_addrlookup πŸ™ˆ
the way that one package pulled in this many absolute legends?? no cap, we're all just standing on their shoulders fr fr.

πŸ‘‘ AUTHOR πŸ‘‘

The lbdb package was initially written by Thomas Roessler <roessler@guug.de>, and is now maintained and heavily extended by Roland Rosenfeld <roland@spinnaker.de>. Main character energy from start to finish, honestly. πŸ’«


That's the whole page, bestie! 🌟 This lil' beauty lives in the Unix manual section, dated June 2025, and goes by LBDBQ(1) β€” so if you ever forget any of it, just hit up that manual page and it'll have your back. Now go look up some addresses, you absolute icon πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from