POSTMAP(1) POSTMAP(1)
[1mNAME[0m
postmap - Postfix lookup table management SYNOPSIS
[1mpostmap [22m[[1m-Nfinoprsuvw[22m] [[1m-c [4m[22mconfig_dir[24m] [[1m-d [4m[22mkey[24m] [[1m-q [4m[22mkey[24m]
[[4mfile_type[24m:][4mfile_name[24m ...
[1mDESCRIPTION[0m
The [1mpostmap[22m(1) command creates or queries one or more
Postfix lookup tables, or updates an existing one. The
input and output file formats are expected to be compati-
ble with:
[1mmakemap [4m[22mfile_type[24m [4mfile_name[24m < [4mfile_name[0m
If the result files do not exist they will be created with
the same group and other read permissions as the source
file.
While the table update is in progress, signal delivery is
postponed, and an exclusive, advisory, lock is placed on
the entire table, in order to avoid surprises in spectator
programs. INPUT FILE FORMAT
The format of a lookup table input file is as follows:
· A table entry has the form
[4mkey[24m whitespace [4mvalue[0m
· Empty lines and whitespace-only lines are ignored,
as are lines whose first non-whitespace character
is a `#'.
· A logical line starts with non-whitespace text. A
line that starts with whitespace continues a logi-
cal line.
The [4mkey[24m and [4mvalue[24m are processed as is, except that sur-
rounding white space is stripped off. Unlike with Postfix
alias databases, quotes cannot be used to protect lookup
keys that contain special characters such as `#' or white-
space. The [4mkey[24m is mapped to lowercase to make mapping
lookups case insensitive. COMMAND-LINE ARGUMENTS
[1m-c [4m[22mconfig_dir[0m
Read the [1mmain.cf [22mconfiguration file in the named
directory instead of the default configuration
directory.
[1m-d [4m[22mkey[24m Search the specified maps for [4mkey[24m and remove one
entry per map. The exit status is zero when the
requested information was found.
If a key value of [1m- [22mis specified, the program reads
key values from the standard input stream. The exit
status is zero when at least one of the requested
keys was found.
[1m-f [22mDo not fold the lookup key to lower case while cre-
ating or querying a map.
[1m-i [22mIncremental mode. Read entries from standard input
and do not truncate an existing database. By
default, [1mpostmap[22m(1) creates a new database from the
entries in [1mfile_name[22m.
[1m-N [22mInclude the terminating null character that termi-
nates lookup keys and values. By default,
[1mpostmap[22m(1) does whatever is the default for the
host operating system.
[1m-n [22mDon't include the terminating null character that
terminates lookup keys and values. By default,
[1mpostmap[22m(1) does whatever is the default for the
host operating system.
[1m-o [22mDo not release root privileges when processing a
non-root input file. By default, [1mpostmap[22m(1) drops
root privileges and runs as the source file owner
instead.
[1m-p [22mDo not inherit the file access permissions from the
input file when creating a new file. Instead, cre-
ate a new file with default access permissions
(mode 0644).
[1m-q [4m[22mkey[24m Search the specified maps for [4mkey[24m and write the
first value found to the standard output stream.
The exit status is zero when the requested informa-
tion was found.
If a key value of [1m- [22mis specified, the program reads
key values from the standard input stream and
writes one line of [4mkey[24m [4mvalue[24m output for each key
that was found. The exit status is zero when at
least one of the requested keys was found.
[1m-r [22mWhen updating a table, do not complain about
attempts to update existing entries, and make those
updates anyway.
[1m-s [22mRetrieve all database elements, and write one line
of [4mkey[24m [4mvalue[24m output for each element. The elements
are printed in database order, which is not neces-
sarily the same as the original input order. This
feature is available in Postfix version 2.2 and
later, and is not available for all database types.
[1m-u [22mUpgrade the database to the current version.
[1m-v [22mEnable verbose logging for debugging purposes. Mul-
tiple [1m-v [22moptions make the software increasingly
verbose.
[1m-w [22mWhen updating a table, do not complain about
attempts to update existing entries, and ignore
those attempts.
Arguments:
[4mfile_type[0m
The database type. To find out what types are sup-
ported, use the "[1mpostconf -m[22m" command.
The [1mpostmap[22m(1) command can query any supported file
type, but it can create only the following file
types:
[1mbtree [22mThe output file is a btree file, named
[4mfile_name[24m[1m.db[22m. This is available on systems
with support for [1mdb [22mdatabases.
[1mcdb [22mThe output consists of one file, named
[4mfile_name[24m[1m.cdb[22m. This is available on systems
with support for [1mcdb [22mdatabases.
[1mdbm [22mThe output consists of two files, named
[4mfile_name[24m[1m.pag [22mand [4mfile_name[24m[1m.dir[22m. This is
available on systems with support for [1mdbm[0m
databases.
[1mhash [22mThe output file is a hashed file, named
[4mfile_name[24m[1m.db[22m. This is available on systems
with support for [1mdb [22mdatabases.
[1msdbm [22mThe output consists of two files, named
[4mfile_name[24m[1m.pag [22mand [4mfile_name[24m[1m.dir[22m. This is
available on systems with support for [1msdbm[0m
databases.
When no [4mfile_type[24m is specified, the software uses
the database type specified via the [1mdefault_data-[0m
[1mbase_type [22mconfiguration parameter.
[4mfile_name[0m
The name of the lookup table source file when
rebuilding a database.
[1mDIAGNOSTICS[0m
Problems are logged to the standard error stream and to
[1msyslogd[22m(8). No output means that no problems were
detected. Duplicate entries are skipped and are flagged
with a warning.
[1mpostmap[22m(1) terminates with zero exit status in case of
success (including successful "[1mpostmap -q[22m" lookup) and
terminates with non-zero exit status in case of failure.
ENVIRONMENT
[1mMAIL_CONFIG[0m
Directory with Postfix configuration files.
[1mMAIL_VERBOSE[0m
Enable verbose logging for debugging purposes.
CONFIGURATION PARAMETERS
The following [1mmain.cf [22mparameters are especially
relevant to this program. The text below provides
only a parameter summary. See [1mpostconf[22m(5) for more
details including examples.
[1mberkeley_db_create_buffer_size (16777216)[0m
The per-table I/O buffer size for programs that
create Berkeley DB hash or btree tables.
[1mberkeley_db_read_buffer_size (131072)[0m
The per-table I/O buffer size for programs that
read Berkeley DB hash or btree tables.
[1mconfig_directory (see 'postconf -d' output)[0m
The default location of the Postfix main.cf and
master.cf configuration files.
[1mdefault_database_type (see 'postconf -d' output)[0m
The default database type for use in [1mnewaliases[22m(1),
[1mpostalias[22m(1) and [1mpostmap[22m(1) commands.
[1msyslog_facility (mail)[0m
The syslog facility of Postfix logging.
[1msyslog_name (postfix)[0m
The mail system name that is prepended to the
process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd". SEE ALSO
postalias(1), create/update/query alias database
postconf(1), supported database types postconf(5),
configuration parameters syslogd(8), system logging
README FILES
Use "[1mpostconf readme_directory[22m" or "[1mpostconf[0m
[1mhtml_directory[22m" to locate this information.
DATABASE_README, Postfix lookup table overview
LICENSE
The Secure Mailer license must be distributed with
this software. AUTHOR(S) Wietse Venema IBM T.J.
Watson Research P.O. Box 704 Yorktown Heights, NY
10598, USA
POSTMAP(1)