94
94
action such as "reject"). </p>
96
96
<p> With some tables, however, Postfix needs to know only if the
97
lookup key exists. The lookup result itself is not used. Examples
97
lookup key exists. Any non-empty lookup result value may be used
98
here: the lookup result is not used. Examples
98
99
are the local_recipient_maps that determine what local recipients
99
100
Postfix accepts in mail from the network, the mydestination parameter
100
101
that specifies what domains Postfix delivers locally, or the
185
187
<h2><a name="safe_db">Updating Berkeley DB files safely</a></h2>
187
<p> Although Postfix uses file locking to avoid access conflicts
188
while updating Berkeley DB or other local database files, you still
189
have a problem when the update fails because the disk is full or
190
because something else happens. This is because commands such as
191
postmap(1) or postalias(1) overwrite existing files. If the update
189
<p> Postfix uses file locking to avoid access conflicts while
190
updating Berkeley DB or other local database files. This used to
191
be safe, but as Berkeley DB has evolved to use more aggressive
192
caching, file locking may no longer be sufficient. </p>
194
<p> Furthermore, file locking would not prevent problems when the
195
update fails because the disk is full or something else causes a
196
database update to fail. In particular, commands such as postmap(1)
197
or postalias(1) overwrite existing files. If the overwrite
192
198
fails in the middle then you have no usable database, and Postfix
193
199
will stop working. This is not an issue with the CDB database type
194
200
available with Postfix 2.2 and later: <a href="CDB_README.html">CDB</a>
195
201
creates a new file, and renames the file upon successful completion.
198
<p> With multi-file databases such as DBM, there is no simple
199
solution. With Berkeley DB and other "one file" databases, it is
204
<p> With Berkeley DB and other "one file" databases, it is
200
205
possible to add some extra robustness by using "mv" to REPLACE an
201
206
existing database file instead of overwriting it: </p>
281
286
<dt> <b>dbm</b> </dt>
283
288
<dd> An indexed file type based on hashing. This is available only
284
on systems with support for DBM databases. Database files are
285
created with the postmap(1) or postalias(1) command. The lookup
286
table name as used in "dbm:table" is the database file name without
287
the ".dir" or ".pag" suffix. </dd>
289
on systems with support for DBM databases. Public database files
290
are created with the postmap(1) or postalias(1) command, and private
291
databases are maintained by Postfix daemons. The lookup table name
292
as used in "dbm:table" is the database file name without the ".dir"
293
or ".pag" suffix. </dd>
289
295
<dt> <b>environ</b> </dt>
301
307
<dt> <b>hash</b> </dt>
303
309
<dd> An indexed file type based on hashing. This is available only
304
on systems with support for Berkeley DB databases. Database files are
305
created with the postmap(1) or postalias(1) command. The database
310
on systems with support for Berkeley DB databases. Public database
311
files are created with the postmap(1) or postalias(1) command, and
312
private databases are maintained by Postfix daemons. The database
306
313
name as used in "hash:table" is the database file name without the
309
316
<dt> <b>internal</b> </dt>
311
318
<dd> A non-shared, in-memory hash table. Its content are lost when
312
319
a process terminates. </dd>
321
<dt> <b>lmdb</b> </dt>
323
<dd> OpenLDAP LMDB database. This is available only on systems
324
with support for LMDB databases. Public database files are created
325
with the postmap(1) or postalias(1) command, and private databases
326
are maintained by Postfix daemons. The database name as used in
327
"lmdb:table" is the database file name without the ".lmdb" suffix.
328
See lmdb_table(5) for details. </dd>
314
330
<dt> <b>ldap</b> (read-only) </dt>
316
<dd> Perform lookups using the LDAP protocol. Configuration details
317
are given in the ldap_table(5). </dd>
332
<dd> LDAP database client. Configuration details are given in the
319
335
<dt> <b>memcache</b> </dt>
321
<dd> Perform memcache database lookups or updates. Configuration
322
details are given in memcache_table(5). </dd>
337
<dd> Memcache database client. Configuration details are given in
338
memcache_table(5). </dd>
324
340
<dt> <b>mysql</b> (read-only) </dt>
326
<dd> Perform MySQL database lookups. Configuration details are given
327
in mysql_table(5). </dd>
342
<dd> MySQL database client. Configuration details are given in
343
mysql_table(5). </dd>
329
345
<dt> <b>netinfo</b> (read-only) </dt>
331
<dd> Perform Netinfo database lookups. </dd>
347
<dd> Netinfo database client. </dd>
333
349
<dt> <b>nis</b> (read-only) </dt>
335
<dd> Perform NIS database lookups. </dd>
351
<dd> NIS database client. </dd>
337
353
<dt> <b>nisplus</b> (read-only) </dt>
339
<dd> Perform NIS+ database lookups. Configuration details are given
340
in nisplus_table(5). </dd>
355
<dd> NIS+ database client. Configuration details are given in
356
nisplus_table(5). </dd>
342
358
<dt> <b>pcre</b> (read-only) </dt>
349
365
<dt> <b>pgsql</b> (read-only) </dt>
351
<dd> Perform PostgreSQL database lookups. Configuration details
352
are given in pgsql_table(5). </dd>
367
<dd> PostgreSQL database client. Configuration details are given
368
in pgsql_table(5). </dd>
354
370
<dt> <b>proxy</b> </dt>
356
<dd> Access information via the Postfix proxymap(8) service. The
357
lookup table name syntax is "proxy:type:table". </dd>
372
<dd> Postfix proxymap(8) client for shared access to Postfix
373
databases. The lookup table name syntax is "proxy:type:table".
359
376
<dt> <b>regexp</b> (read-only) </dt>
365
382
<dt> <b>sdbm</b> </dt>
367
384
<dd> An indexed file type based on hashing. This is available only
368
on systems with support for SDBM databases. Database files are
369
created with the postmap(1) or postalias(1) command. The lookup
370
table name as used in "sdbm:table" is the database file name without
371
the ".dir" or ".pag" suffix. </dd>
385
on systems with support for SDBM databases. Public database files
386
are created with the postmap(1) or postalias(1) command, and private
387
databases are maintained by Postfix daemons. The lookup table name
388
as used in "sdbm:table" is the database file name without the ".dir"
389
or ".pag" suffix. </dd>
373
391
<dt> <b>socketmap</b> (read-only) </dt>
375
<dd> Query a Sendmail-style socketmap server. The name of the table
376
specifies <b>inet</b>:<i>host</i>:<i>port</i>:<i>socketmap-name</i>
377
for a TCP-based server, or
378
<b>unix</b>:<i>pathname</i>:<i>socketmap-name</i> for a UNIX-domain
379
server. In both cases <i>socketmap-name</i> is the name of the
393
<dd> Sendmail-style socketmap client. The name of the table is
394
either <b>inet</b>:<i>host</i>:<i>port</i>:<i>name</i> for a TCP/IP
395
server, or <b>unix</b>:<i>pathname</i>:<i>name</i> for a UNIX-domain
396
server. See socketmap_table(5) for details. </dd>
382
398
<dt> <b>sqlite</b> (read-only) </dt>
384
<dd> Perform SQLite database lookups. Configuration details are given
385
in sqlite_table(5). </dd>
400
<dd> SQLite database. Configuration details are given in sqlite_table(5).
387
403
<dt> <b>static</b> (read-only) </dt>
389
<dd> Always returns its lookup table name as lookup result. For
390
example, the lookup table "static:foobar" always returns the string
391
"foobar" as lookup result. </dd>
405
<dd> A table that always returns its name as the lookup result.
406
For example, "static:foobar" always returns the string "foobar" as
393
409
<dt> <b>tcp</b> </dt>
395
<dd> Access information through a TCP/IP server. The protocol is
396
described in tcp_table(5). The lookup table name is "tcp:host:port"
397
where "host" specifies a symbolic hostname or a numeric IP address,
398
and "port" specifies a symbolic service name or a numeric port
411
<dd> TCP/IP client. The protocol is described in tcp_table(5). The
412
lookup table name is "tcp:host:port" where "host" specifies a
413
symbolic hostname or a numeric IP address, and "port" specifies a
414
symbolic service name or a numeric port number. </dd>
402
416
<dt> <b>texthash</b> (read-only) </dt>
404
<dd> This produces similar results as hash: files, except that you
405
don't have to run the postmap(1) command before you can use the
406
file, and that texthash: does not detect changes after the file is
407
read. The lookup table name is "texthash:filename", where the file
408
name is taken literally; no suffix is appended. </dd>
418
<dd> A table that produces similar results as hash: files, except
419
that you don't have to run the postmap(1) command before you can
420
use the file, and that texthash: does not detect changes after the
421
file is read. The lookup table name is "texthash:filename", where
422
the file name is taken literally; no suffix is appended. </dd>
410
424
<dt> <b>unix</b> (read-only) </dt>
412
<dd> A limited way to query the UNIX authentication database. The
413
following tables are implemented:
426
<dd> A limited view of the UNIX authentication database. The following
427
tables are implemented: