POSTMAP(1) General Commands Manual POSTMAP(1) [1mNAME[0m postmap - Postfix lookup table management [1mSYNOPSIS[0m [1mpostmap [22m[[1m-Nbfhimnoprsuvw[22m] [[1m-c [4m[22mconfig_dir[24m] [[1m-d [4m[22mkey[24m] [[1m-q[0m [4mkey[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 their 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 processes. [1mINPUT FILE FORMAT[0m 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. By default the lookup key is mapped to lowercase to make the lookups case insensitive; as of Postfix 2.3 this case folding happens only with tables whose lookup keys are fixed-case strings such as btree:, dbm: or hash:. With earlier versions, the lookup key is folded even with tables where a lookup field can match both upper and lower case text, such as regexp: and pcre:. This resulted in loss of information with $[4mnumber[24m substitutions. [1mCOMMAND-LINE ARGUMENTS[0m [1m-b [22mEnable message body query mode. When reading lookup keys from standard input with "[1m-q -[22m", process the input as if it is an email message in RFC 2822 for‐ mat. Each line of body content becomes one lookup key. By default, the [1m-b [22moption starts generating lookup keys at the first non-header line, and stops when the end of the message is reached. To simulate [1mbody_checks[22m(5) processing, enable MIME parsing with [1m-m[22m. With this, the [1m-b [22moption generates no body- style lookup keys for attachment MIME headers and for attached message/* headers. This feature is available in Postfix version 2.6 and later. [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 table. With Postfix version 2.3 and later, this option has no effect for regular expression tables. There, case folding is controlled by appending a flag to a pattern. [1m-h [22mEnable message header query mode. When reading lookup keys from standard input with "[1m-q -[22m", process the input as if it is an email message in RFC 2822 format. Each logical header line becomes one lookup key. A multi-line header becomes one lookup key with one or more embedded newline char‐ acters. By default, the [1m-h [22moption generates lookup keys until the first non-header line is reached. To simulate [1mheader_checks[22m(5) processing, enable MIME parsing with [1m-m[22m. With this, the [1m-h [22moption also gen‐ erates header-style lookup keys for attachment MIME headers and for attached message/* headers. This feature is available in Postfix version 2.6 and later. [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-m [22mEnable MIME parsing with "[1m-b[22m" and "[1m-h[22m". This feature is available in Postfix version 2.6 and later. [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. [1mfail [22mA table that reliably fails all requests. The lookup table name is used for logging only. This table exists to simplify Postfix error tests. [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. [1mENVIRONMENT[0m [1mMAIL_CONFIG[0m Directory with Postfix configuration files. [1mMAIL_VERBOSE[0m Enable verbose logging for debugging purposes. [1mCONFIGURATION PARAMETERS[0m 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 exam‐ ples. [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 (see 'postconf -d' output)[0m The mail system name that is prepended to the process name in syslog records, so that "smtpd" becomes, for example, "postfix/smtpd". [1mSEE ALSO[0m postalias(1), create/update/query alias database postconf(1), supported database types postconf(5), configuration parameters syslogd(8), system logging [1mREADME FILES[0m [1mtory[22m" to locate this information. DATABASE_README, Postfix lookup table overview [1mLICENSE[0m The Secure Mailer license must be distributed with this software. [1mAUTHOR(S)[0m Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA POSTMAP(1)