NetBSD/gnu/dist/postfix/man/man1/postmap.1

145 lines
4.4 KiB
Groff

.TH POSTMAP 1
.ad
.fi
.SH NAME
postmap
\-
Postfix lookup table management
.SH SYNOPSIS
.na
.nf
.fi
\fBpostmap\fR [\fB-Ninrvw\fR] [\fB-c \fIconfig_dir\fR] [\fB-d \fIkey\fR]
[\fB-q \fIkey\fR] [\fIfile_type\fR:]\fIfile_name\fR ...
.SH DESCRIPTION
.ad
.fi
The \fBpostmap\fR 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 compatible with:
.ti +4
\fBmakemap \fIfile_type\fR \fIfile_name\fR < \fIfile_name\fR
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.
The format of a lookup table input file is as follows:
.IP \(bu
Blank lines are ignored. So are lines beginning with `#'.
.IP \(bu
A table entry has the form
.sp
.ti +5
\fIkey\fR whitespace \fIvalue\fR
.IP \(bu
A line that starts with whitespace continues the preceding line.
.PP
The \fIkey\fR and \fIvalue\fR are processed as is, except that
surrounding 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 whitespace. The \fIkey\fR is mapped
to lowercase to make mapping lookups case insensitive.
Options:
.IP \fB-N\fR
Include the terminating null character that terminates lookup keys
and values. By default, Postfix does whatever is the default for
the host operating system.
.IP "\fB-c \fIconfig_dir\fR"
Read the \fBmain.cf\fR configuration file in the named directory
instead of the default configuration directory.
.IP "\fB-d \fIkey\fR"
Search the specified maps for \fIkey\fR and remove one entry per map.
The exit status is non-zero if the requested information was not found.
.IP \fB-i\fR
Incremental mode. Read entries from standard input and do not
truncate an existing database. By default, \fBpostmap\fR creates
a new database from the entries in \fBfile_name\fR.
.IP \fB-n\fR
Don't include the terminating null character that terminates lookup
keys and values. By default, Postfix does whatever is the default for
the host operating system.
.IP "\fB-q \fIkey\fR"
Search the specified maps for \fIkey\fR and print the first value
found on the standard output stream. The exit status is non-zero
if the requested information was not found.
.IP \fB-r\fR
When updating a table, do not warn about duplicate entries; silently
replace them.
.IP \fB-v\fR
Enable verbose logging for debugging purposes. Multiple \fB-v\fR
options make the software increasingly verbose.
.IP \fB-w\fR
When updating a table, do not warn about duplicate entries; silently
ignore them.
.PP
Arguments:
.IP \fIfile_type\fR
The type of database to be produced.
.RS
.IP \fBbtree\fR
The output file is a btree file, named \fIfile_name\fB.db\fR.
This is available only on systems with support for \fBdb\fR databases.
.IP \fBdbm\fR
The output consists of two files, named \fIfile_name\fB.pag\fR and
\fIfile_name\fB.dir\fR.
This is available only on systems with support for \fBdbm\fR databases.
.IP \fBhash\fR
The output file is a hashed file, named \fIfile_name\fB.db\fR.
This is available only on systems with support for \fBdb\fR databases.
.PP
When no \fIfile_type\fR is specified, the software uses the database
type specified via the \fBdatabase_type\fR configuration parameter.
.RE
.IP \fIfile_name\fR
The name of the lookup table source file when rebuilding a database.
.SH DIAGNOSTICS
.ad
.fi
Problems and transactions are logged to the standard error
stream. No output means no problems. Duplicate entries are
skipped and are flagged with a warning.
\fBpostmap\fR terminates with zero exit status in case of success
(including successful \fBpostmap -q\fR lookup) and terminates
with non-zero exit status in case of failure.
.SH BUGS
.ad
.fi
The "delete key" support is limited to one delete operation
per command invocation.
.SH ENVIRONMENT
.na
.nf
.ad
.fi
.IP \fBMAIL_CONFIG\fR
Directory with Postfix configuration files.
.IP \fBMAIL_VERBOSE\fR
Enable verbose logging for debugging purposes.
.SH CONFIGURATION PARAMETERS
.na
.nf
.ad
.fi
.IP \fBdatabase_type\fR
Default output database type.
On many UNIX systems, the default database type is either \fBhash\fR
or \fBdbm\fR.
.SH LICENSE
.na
.nf
.ad
.fi
The Secure Mailer license must be distributed with this software.
.SH AUTHOR(S)
.na
.nf
Wietse Venema
IBM T.J. Watson Research
P.O. Box 704
Yorktown Heights, NY 10598, USA