LMDB_TABLE(5)
π LMDB_TABLE(5) π
okay bestie, welcome to the File Formats Manual entry for lmdb_table β yes the manual section number is literally (5), we love a numbered era. this is the Postfix LMDB adapter and she is iconic, let's get into it. π
β¨ NAME β¨
lmdb_table β the Postfix LMDB adapter. that's it, that's the whole name, short and slay. π
β¨ SYNOPSIS β¨
postmap lmdb:/etc/postfix/filename
postmap -i lmdb:/etc/postfix/filename <inputfile
postmap -d "key" lmdb:/etc/postfix/filename
postmap -d - lmdb:/etc/postfix/filename <inputfile
postmap -q "key" lmdb:/etc/postfix/filename
postmap -q - lmdb:/etc/postfix/filename <inputfile
like, that's the entire vibe check right there. you either build the thing, delete from the thing, or ask the thing a question. π¦
β¨ DESCRIPTION β¨
so the Postfix LMDB adapter gives you access to a persistent, memory-mapped, key-value store. yes bestie, memory-mapped. it's giving fast. β‘
and the database size? literally only limited by two things:
- the size of the memory address space β typically 31 or 47 bits on 32-bit or 64-bit CPUs respectively
- the available file system space
no cap, that's genuinely the whole limit. π
β¨ REQUESTS β¨
the LMDB adapter supports all Postfix lookup table operations. every single one. so LMDB is suitable for:
- Postfix address rewriting
- routing
- access policies
- caches
- literally any information that can be stored under a fixed lookup key
and here's the cute part β when a transaction fails because the database is full, Postfix resizes the database and retries the transaction. she just grows. π±
also, Postfix table lookups may generate partial search keys, like:
- domain names without one or more subdomains
- network addresses without one or more least-significant octets
- email addresses without the localpart, address extension or domain portion
this behavior is also found with, for example, btree:, hash:, or ldap: tables. so it's not a weird LMDB thing, it's a whole family trait. π«Ά
one more thing: changes to an LMDB database do not trigger an automatic daemon restart, and do not require a daemon restart with "postfix reload". so like... breathe, bestie, you're fine. π
β¨ RELIABILITY β¨
LMDB's copy-on-write architecture provides safe updates β at the cost of using more space than some other flat-file databases. trade-offs, we've all been there. π
- Read operations are memory-mapped, for speed. zoom zoom. π₯
- Write operations are not memory-mapped, to avoid silent corruption due to stray pointer bugs. protective queen behavior honestly.
and get this: multiple processes can safely update an LMDB database without serializing requests through the proxymap(8) service. so LMDB is suitable as a shared cache for verify(8) or postscreen(8) services. teamwork makes the dream work. π
β¨ SYNCHRONIZATION β¨
okay this section is important, so eyes up. π
the Postfix LMDB adapter does not use LMDB's built-in locking scheme, because that would require world-writable lockfiles and therefore violate the Postfix security model. nope, not happening, we don't do that here.
instead, Postfix uses fcntl(2) locks with whole-file granularity.
π¨ bestie listen: programs that use LMDB's built-in locking protocol will corrupt a Postfix LMDB database or will read garbage. i am not being dramatic. this is a real warning. do not do it.
every Postfix LMDB database read or write transaction must be protected from start to end with a shared or exclusive fcntl(2) lock. and:
- a process may atomically downgrade an exclusive lock to a shared lock before opening a database read transaction
- but it must hold an exclusive lock while opening a write transaction
also (and this one gets people every time): fcntl(2) locks do not protect transactions within the same process against each other. so if a program cannot avoid making simultaneous database requests, it must protect its transactions with in-process locks, in addition to the per-process fcntl(2) locks. two locks. two layers. that's the gig. π
β¨ CONFIGURATION PARAMETERS β¨
short-lived programs automatically pick up changes to main.cf. but with long-running daemon programs, use the command "postfix reload" after a configuration change. don't forget, she's not psychic. π§
lmdb_map_size(16777216) β the initial OpenLDAP LMDB database size limit, in bytes.
β¨ SEE ALSO β¨
postconf(1), Postfix supported lookup tablespostmap(1), Postfix lookup table maintenancepostconf(5), configuration parameters
β¨ README FILES β¨
use "postconf readme_directory" or "postconf html_directory" to locate this information. very handy, very demure. π
DATABASE_README, Postfix lookup table overviewLMDB_README, Postfix OpenLDAP LMDB howto
β¨ LICENSE β¨
the Secure Mailer license must be distributed with this software. periodt. π
β¨ HISTORY β¨
LMDB support was introduced with Postfix version 2.11. an elder. a legend. she's been here a minute. π«‘
β¨ AUTHOR(S) β¨
- Howard Chu β Symas Corporation
- Wietse Venema β IBM T.J. Watson Research, P.O. Box 704, Yorktown Heights, NY 10598, USA
- Wietse Venema β Google, Inc., 111 8th Avenue, New York, NY 10011, USA
and that's the whole page bestie!! π we got the LMDB_TABLE(5) entry, straight out of the File Formats Manual, footer and all β LMDB_TABLE(5) for you and your daemons. go forth, lock your transactions, and slay. πβ¨πΈ
π¦ where this page comes from
- alpine 3.24: postfix-doc 3.11.7-r0 Β· IPL-1.0 EPL-2.0
- arch rolling: postfix-lmdb 3.11.7-1 Β· EPL-2.0 OR IPL-1.0 AND BSD-4-Clause-UC
- nixos 26.05: postfix 3.11.7
- nixpkgs unstable: postfix 3.11.7
- ubuntu stonking: postfix 3.11.7-1ubuntu2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms