LBDB-FETCHADDR(1)
π lbdb-fetchaddr β the manual page, but make it cute
okay so bestie, this is lbdb-fetchaddr(1) from the User Manuals section, and it's genuinely one of the most lowkey iconic little scripts in the whole lbdb package. it grabs addresses from your mail and appends them to the lbdb database. that's the whole vibe. let's get into it π
β¨ NAME β¨
lbdb-fetchaddr β grab addresses from mails and append them to the lbdb database π«Ά
πΈ SYNOPSIS πΈ
lbdb-fetchaddr [-d dateformat] [-x headerfieldlist] [-c charset] [-a] [-f databasefile]
lbdb-fetchaddr [-v|-h]
π DESCRIPTION π
so like, lbdb-fetchaddr is a shell script, right? and what it does is it reads a mail on stdin. yes, the whole mail, straight in through the front door πͺ
then it extracts the contents of some header fields β and the defaults are From:, To:, Cc:, Resent-From:, and Resent-To: β out of the mail header. only addresses with a real name though, just so we're clear π
then it appends them to the database file. and that file defaults to $XDG_DATA_HOME/lbdb/m_inmail.db, or $HOME/.lbdb/m_inmail.utf-8 if the latter already exists β that one's there for backward compatibility, iykyk π¦
ngl there's a whole thing here about performance. for performance issues,lbdb-fetchaddrappends new addresses to this file without removing duplicates. it's just not doing that. periodt. to actually get rid of duplicates, the programlbdb-mungeexists, and it gets run bym_inmailif needed, and it removes the duplicates. so that's the division of labour, bestie π
so to use this program, you put the following lines into your $HOME/.procmailrc:
:0hc
| lbdb-fetchaddr
lbdb-fetchaddr writes the actual date to the third column of the database, using strftime(3). it uses "%Y-%m-%d %H:%M" as the default date format (e.g. "1999-04-29 14:33"). you can change this by using the -d option to select a different date format string as parameter of the lbdb-fetchaddr command, like:
:0hc
| lbdb-fetchaddr -d "%y-%m-%d"
which results in e.g. "99-04-29". obsessed with the flexibility honestly π
π OPTIONS π
-vβ print version number oflbdb-fetchaddr. short and sweet, she's just saying hi π-hβ print short help oflbdb-fetchaddr. the little "here's how you use me" moment π₯Ί-ddateformat β use the given date format usingstrftime(3)syntax. your date, your rules β¨-xheaderfields β a colon separated list of header fields, which should be searched for mail addresses. if this option isn't given, we fall back tofrom:to:cc:resent-from:resent-to. note the colons, not commas, bestie, do not get it twisted π-ccharset β the charset which will be used to write the database. this should be the charset which the application expects (normally the one from your current locale). if this option isn't given, we fall back toutf-8. she's giving locale-aware π-aβ also grab addresses without a real name. use the local part of the mail address as real name. so like, no name? fine, we're using the part before the@. main character energy, honestly π-fdatabasefile β use the given file for storing the grabbed addresses instead of using the$XDG_DATA_HOME/lbdb/m_inmail.dbresp.$HOME/.lbdb/m_inmail.utf-8default. you want it somewhere else? say less πΈ
π¦ FILES π¦
$XDG_DATA_HOME/lbdb/m_inmail.db$HOME/.lbdb/m_inmail.utf-8(old version before using$XDG_DATA_HOME)$HOME/.lbdb/m_inmail.list(old version used for ISO-8859-15 encoded addresses)/usr/libexec/lbdb/fetchaddr/usr/libexec/lbdb/m_inmail
π₯ SEE ALSO π₯
lbdbq(1), lbdb_dotlock(1), procmail(1), procmailrc(5), strftime(3).
go read those too, they're all part of the family π«Ά
β CREDITS β
most of the really interesting code of this program (namely, the RFC 822 address parser used by lbdb-fetchaddr) was stolen from Michael Elkins' mutt mail user agent. okay not "stolen" stolen, it's a credit, we're being honest here π
additional credits go to Brandon Long for putting the query functionality into mutt. kings, both of them π
π AUTHOR π
the lbdb package was written by Thomas Roessler <roessler@guug.de> and is now maintained and extended by Roland Rosenfeld <roland@spinnaker.de>.
okay that's the whole page bestie, you're fully caught up, no cap π
and that's a wrap on lbdb-fetchaddr(1) β this one lives in the Unix User Manuals, dated April 2025, and it ate, fr fr. go fetch some addresses, you've got this πβ¨π
π¦ where this page comes from
- ubuntu resolute: lbdb 0.57-1 Β· GPL-2.0-or-later
- ubuntu stonking: lbdb 0.57-1 Β· GPL-2.0-or-later
- Copyright (c) 1998-2025 Roland Rosenfeld <roland@spinnaker.de>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms