1 1.1 tron <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 1.1.1.5 christos "https://www.w3.org/TR/html4/loose.dtd"> 3 1.1 tron <html> <head> 4 1.1.1.3 christos <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5 1.1.1.4 christos <link rel='stylesheet' type='text/css' href='postfix-doc.css'> 6 1.1 tron <title> Postfix manual - lmdb_table(5) </title> 7 1.1 tron </head> <body> <pre> 8 1.1 tron LMDB_TABLE(5) LMDB_TABLE(5) 9 1.1 tron 10 1.1.1.5 christos <b><a name="name">NAME</a></b> 11 1.1 tron lmdb_table - Postfix LMDB adapter 12 1.1 tron 13 1.1.1.5 christos <b><a name="synopsis">SYNOPSIS</a></b> 14 1.1 tron <b>postmap <a href="lmdb_table.5.html">lmdb</a>:/etc/postfix/</b><i>filename</i> 15 1.1 tron <b>postmap -i <a href="lmdb_table.5.html">lmdb</a>:/etc/postfix/</b><i>filename</i> <<i>inputfile</i> 16 1.1 tron 17 1.1 tron <b>postmap -d "</b><i>key</i><b>" <a href="lmdb_table.5.html">lmdb</a>:/etc/postfix/</b><i>filename</i> 18 1.1 tron <b>postmap -d - <a href="lmdb_table.5.html">lmdb</a>:/etc/postfix/</b><i>filename</i> <<i>inputfile</i> 19 1.1 tron 20 1.1 tron <b>postmap -q "</b><i>key</i><b>" <a href="lmdb_table.5.html">lmdb</a>:/etc/postfix/</b><i>filename</i> 21 1.1 tron <b>postmap -q - <a href="lmdb_table.5.html">lmdb</a>:/etc/postfix/</b><i>filename</i> <<i>inputfile</i> 22 1.1 tron 23 1.1.1.5 christos <b><a name="description">DESCRIPTION</a></b> 24 1.1.1.2 christos The Postfix LMDB adapter provides access to a persistent, mem- 25 1.1.1.2 christos ory-mapped, key-value store. The database size is limited only by the 26 1.1.1.2 christos size of the memory address space (typically 31 or 47 bits on 32-bit or 27 1.1 tron 64-bit CPUs, respectively) and by the available file system space. 28 1.1 tron 29 1.1.1.5 christos <b><a name="requests">REQUESTS</a></b> 30 1.1 tron The LMDB adapter supports all Postfix lookup table operations. This 31 1.1 tron makes LMDB suitable for Postfix address rewriting, routing, access 32 1.1 tron policies, caches, or any information that can be stored under a fixed 33 1.1 tron lookup key. 34 1.1 tron 35 1.1 tron When a transaction fails due to a full database, Postfix resizes the 36 1.1 tron database and retries the transaction. 37 1.1 tron 38 1.1 tron Postfix table lookups may generate partial search keys such as domain 39 1.1 tron names without one or more subdomains, network addresses without one or 40 1.1 tron more least-significant octets, or email addresses without the local- 41 1.1 tron part, address extension or domain portion. This behavior is also found 42 1.1 tron with, for example, <a href="DATABASE_README.html#types">btree</a>:, <a href="DATABASE_README.html#types">hash</a>:, or <a href="ldap_table.5.html">ldap</a>: tables. 43 1.1 tron 44 1.1.1.3 christos Changes to an LMDB database do not trigger an automatic daemon restart, 45 1.1.1.3 christos and do not require a daemon restart with "<b>postfix reload</b>". 46 1.1 tron 47 1.1.1.5 christos <b><a name="reliability">RELIABILITY</a></b> 48 1.1 tron LMDB's copy-on-write architecture provides safe updates, at the cost of 49 1.1.1.3 christos using more space than some other flat-file databases. Read operations 50 1.1 tron are memory-mapped for speed. Write operations are not memory-mapped to 51 1.1.1.2 christos avoid silent corruption due to stray pointer bugs. 52 1.1 tron 53 1.1 tron Multiple processes can safely update an LMDB database without serializ- 54 1.1 tron ing requests through the <a href="proxymap.8.html">proxymap(8)</a> service. This makes LMDB suitable 55 1.1 tron as a shared cache for <a href="verify.8.html">verify(8)</a> or <a href="postscreen.8.html">postscreen(8)</a> services. 56 1.1 tron 57 1.1.1.5 christos <b><a name="synchronization">SYNCHRONIZATION</a></b> 58 1.1.1.3 christos The Postfix LMDB adapter does not use LMDB's built-in locking scheme, 59 1.1.1.6 christos because that would require world-writable lockfiles and therefore vio- 60 1.1.1.6 christos late the Postfix security model. Instead, Postfix uses fcntl(2) locks 61 1.1.1.6 christos with whole-file granularity. Programs that use LMDB's built-in locking 62 1.1.1.6 christos protocol will corrupt a Postfix LMDB database or will read garbage. 63 1.1 tron 64 1.1 tron Every Postfix LMDB database read or write transaction must be protected 65 1.1.1.6 christos from start to end with a shared or exclusive fcntl(2) lock. A process 66 1.1.1.6 christos may atomically downgrade an exclusive lock to a shared lock before 67 1.1.1.6 christos opening a database read transaction, but it must hold an exclusive lock 68 1.1.1.6 christos while opening a write transaction. 69 1.1.1.6 christos 70 1.1.1.6 christos Note that fcntl(2) locks do not protect transactions within the same 71 1.1.1.6 christos process against each other. If a program cannot avoid making simulta- 72 1.1.1.6 christos neous database requests, then it must protect its transactions with 73 1.1.1.2 christos in-process locks, in addition to the per-process fcntl(2) locks. 74 1.1 tron 75 1.1.1.5 christos <b><a name="configuration_parameters">CONFIGURATION PARAMETERS</a></b> 76 1.1.1.6 christos Short-lived programs automatically pick up changes to <a href="postconf.5.html">main.cf</a>. With 77 1.1.1.6 christos long-running daemon programs, Use the command "<b>postfix reload</b>" after a 78 1.1 tron configuration change. 79 1.1 tron 80 1.1.1.3 christos <b><a href="postconf.5.html#lmdb_map_size">lmdb_map_size</a> (16777216)</b> 81 1.1.1.3 christos The initial OpenLDAP LMDB database size limit in bytes. 82 1.1 tron 83 1.1.1.5 christos <b><a name="see_also">SEE ALSO</a></b> 84 1.1 tron <a href="postconf.1.html">postconf(1)</a>, Postfix supported lookup tables 85 1.1 tron <a href="postmap.1.html">postmap(1)</a>, Postfix lookup table maintenance 86 1.1 tron <a href="postconf.5.html">postconf(5)</a>, configuration parameters 87 1.1 tron 88 1.1.1.5 christos <b><a name="readme_files">README FILES</a></b> 89 1.1 tron <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview 90 1.1 tron <a href="LMDB_README.html">LMDB_README</a>, Postfix OpenLDAP LMDB howto 91 1.1 tron 92 1.1.1.5 christos <b><a name="license">LICENSE</a></b> 93 1.1 tron The Secure Mailer license must be distributed with this software. 94 1.1 tron 95 1.1.1.5 christos <b><a name="history">HISTORY</a></b> 96 1.1 tron LMDB support was introduced with Postfix version 2.11. 97 1.1 tron 98 1.1 tron <b>AUTHOR(S)</b> 99 1.1 tron Howard Chu 100 1.1 tron Symas Corporation 101 1.1 tron 102 1.1 tron Wietse Venema 103 1.1 tron IBM T.J. Watson Research 104 1.1 tron P.O. Box 704 105 1.1 tron Yorktown Heights, NY 10598, USA 106 1.1 tron 107 1.1.1.2 christos Wietse Venema 108 1.1.1.2 christos Google, Inc. 109 1.1.1.2 christos 111 8th Avenue 110 1.1.1.2 christos New York, NY 10011, USA 111 1.1.1.2 christos 112 1.1 tron LMDB_TABLE(5) 113 1.1 tron </pre> </body> </html> 114