The hosts that Postfix will try to connect to and query from.
Specify unix: for UNIX-domain sockets, inet: for TCP
connections (default). Example:
hosts = host1.some.domain host2.some.domain:port hosts = unix:/file/name
The hosts are tried in random order, with all connections over UNIX domain sockets being tried before those over TCP. The connections are automatically closed after being idle for about 1 minute, and are re-opened as necessary.
NOTE: the unix: and inet: prefixes are accepted for backwards compatibility reasons, but are actually ignored. The PostgreSQL client library will always try to connect to an UNIX socket if the name starts with a slash, and will try a TCP connection otherwise.
The user name and password to log into the pgsql server.
user = someone password = some_password
The database name on the servers. Example:
dbname = customer_database
The SQL query template used to search the database, where %s
is a substitute for the address Postfix is trying to resolve,
query = SELECT replacement FROM aliases WHERE mailbox = %s
This parameter supports the following % expansions:
The domain parameter described below limits the input
keys to addresses in matching domains. When the domain
parameter is non-empty, SQL queries for unqualified addresses
or addresses in non-matching domains are suppressed
and return no results.
The precedence of this parameter has changed with Postfix 2.2, in prior releases the precedence was, from highest to lowest, select_function, query, select_field, ...
With Postfix 2.2 the query parameter has highest precedence, see COMPATIBILITY above.
NOTE: DO NOT put quotes around the query parameter.
|result_format (default: %s)||
Format template applied to result attributes. Most commonly used
to append (or prepend) text to the result. This parameter supports
the following % expansions:
For example, using "result_format = smtp:[%s]" allows one
to use a mailHost attribute as the basis of a transport(5)
table. After applying the result format, multiple values
are concatenated as comma separated strings. The expansion_limit
and parameter explained below allows one to restrict the number
of values in the result, which is especially useful for maps that
must return at most one value.
The default value %s specifies that each result value should be used as is.
This parameter is available with Postfix 2.2 and later.
NOTE: DO NOT put quotes around the result format!
|domain (default: no domain list)||
This is a list of domain names, paths to files, or
dictionaries. When specified, only fully qualified search
keys with a *non-empty* localpart and a matching domain
are eligible for lookup: user lookups, bare domain lookups
and "@domain" lookups are not performed. This can significantly
reduce the query load on the PostgreSQL server.
domain = postfix.org, hash:$config_directory/searchdomains
It is best not to use SQL to store the domains eligible for SQL lookups.
This parameter is available with Postfix 2.2 and later.
NOTE: DO NOT define this parameter for local(8) aliases, because the input keys are always unqualified.
|expansion_limit (default: 0)||A limit on the total number of result elements returned (as a comma separated list) by a lookup against the map. A setting of zero disables the limit. Lookups fail with a temporary error if the limit is exceeded. Setting the limit to 1 ensures that lookups do not return multiple values.|
This section describes query interfaces that are deprecated as of Postfix 2.2. Please migrate to the new query interface as the old interfaces are slated to be phased out.
select_function This parameter specifies a database function name. Example:select_function = my_lookup_user_alias
This is equivalent to:query = SELECT my_lookup_user_alias(%s)
This parameter overrides the legacy table-related fields (described below). With Postfix versions prior to 2.2, it also overrides the query parameter. Starting with Postfix 2.2, the query parameter has highest precedence, and the select_function parameter is deprecated.
The following parameters (with lower precedence than the select_function interface described above) can be used to build the SQL select statement as follows:
SELECT [select_field] FROM [table] WHERE [where_field] = %s [additional_conditions]
The specifier %s is replaced with each lookup by the lookup key and is escaped so if it contains single quotes or other odd characters, it will not cause a parse error, or worse, a security problem.
Starting with Postfix 2.2, this interface is obsoleted by the more general query interface described above. If higher precedence the query or select_function parameters described above are defined, the parameters described here are ignored.
select_field The SQL "select" parameter. Example:select_field = forw_addr table The SQL "select .. from" table name. Example:table = mxaliases where_field The SQL "select .. where" parameter. Example:where_field = alias additional_conditions Additional conditions to the SQL query. Example:additional_conditions = AND status = paid
postmap(1), Postfix lookup table manager postconf(5), configuration parameters ldap_table(5), LDAP lookup tables mysql_table(5), MySQL lookup tables sqlite_table(5), SQLite lookup tables
Use "postconf readme_directory" or "postconf html_directory" to locate this information.DATABASE_README, Postfix lookup table overview PGSQL_README, Postfix PostgreSQL client guide
The Secure Mailer license must be distributed with this software.
PgSQL support was introduced with Postfix version 2.1.
Based on the MySQL client by: Scott Cotton, Joshua Marcus IC Group, Inc.
Ported to PostgreSQL by: Aaron Sethman
Further enhanced by: Liviu Daia Institute of Mathematics of the Romanian Academy P.O. BOX 1-764 RO-014700 Bucharest, ROMANIA