PGSQL_TABLE(5) File Formats Manual PGSQL_TABLE(5) (NAME) pgsql_table - PostgreSQL Postfix (SYNOPSIS) postmap -q "string" pgsql:/etc/postfix/filename postmap -q - pgsql:/etc/postfix/filename (DESCRIPTION) Postfix . lmdb: cdb: hash: dbm: . PostgreSQL . Postfix "postconf -m" . PostgreSQL PostgreSQL main.cf : alias_maps = pgsql:/etc/postfix/pgsql-aliases.cf /etc/postfix/pgsql-aliases.cf main.cf Postfix . (LIST MEMBERSHIP) SQL $mynetworks $mydestination $relay_domains $local_recipient_maps . * * . "Postfix lists versus tables" DATABASE_README . $mydestination $relay_domains IP $mynetworks . . SQL . PGSQL (PGSQL PARAMETERS) hosts Postfix . URI PostgreSQL unix:/pathname (UNIX-domain) inet:host:port TCP unix: inet: . : hosts = postgresql://username@example.com/databasename?sslmode=require hosts = postgres://user:secret@localhost hosts = inet:host1.some.domain inet:host2.some.domain:port hosts = host1.some.domain host2.some.domain:port hosts = unix:/file/name URI https://www.postgresql.org/docs/current/libpq-connect.html . . . idle_interval . : hosts URI PostgreSQL PostgreSQL Postfix dbname user password . : hosts (load balancer) . 3.9 Postfix . user password pgsql. : user = someone password = some_password user password hosts URI . dbname . : dbname = customer_database dbname hosts URI . dbname Postfix 3.10 hosts URI Postfix . encoding . : encoding = UTF8 LATIN1 . Postfix 3.8 . idle_interval (: 60) . Postfix 3.9 . retry_interval (: 60) . : hosts . 3.9 Postfix . Postfix 3.9 . query SQL %s Postfix : query = SELECT replacement FROM aliases WHERE mailbox = '%s' '%' : %% '%' . (Postfix 2.2 ) %s . SQL (SQL quoting) (metacharacters) . %u user@domain %u (local part) SQL . %u . . %d user@domain %d SQL . . %[SUD] query . result_format ( ) . %S %U %D Postfix 2.2 . %[1-9] %1 %2 ... %9 . user@mail.example.com %1 com %2 example %3 mail . (unqualified) . %1 ... %9 Postfix 2.2 . domain . domain SQL . Postfix 2.2 : select_function query select_field ... Postfix 2.2 query . : query . result_format (: %s) . ( ) . '%' : %% '%' . %s . . %u user@domain %u . . %d user@domain %d . . %[SUD1-9] . query . "result_format = smtp:[%s]" mailHost transport(5) . . expansion_limit . %s . Postfix 2.2 . : (result format) ! domain (: ) "type:table". ** : 'user' "@domain" . PostgreSQL . domain = postfix.org, hash:/etc/postfix/searchdomains SQL SQL . Postfix 2.2 . : local(8) (unqualified) . expansion_limit (: 0) ( ) . . . 1 . MAIN.CF (OBSOLETE MAIN.CF PARAMETERS) Postfix PostgreSQL main.cf . PostgreSQL . PostgreSQL (_) . "pgsql:pgsqlname" "hosts" main.cf "pgsqlname_hosts" . : PostgreSQL main.cf . Postfix . (OBSOLETE QUERY INTERFACES) 2.2 Postfix . query . select_function . : select_function = my_lookup_user_alias : query = SELECT my_lookup_user_alias('%s') ( ) . 2.2 Postfix query . 2.2 Postfix query select_function . ( select_function ) select SQL : SELECT [select_field] FROM [table] WHERE [where_field] = '%s' [additional_conditions] %s . Postfix 2.2 query . query select_function . select_field "select" SQL. : select_field = forw_addr table "select .. from" SQL. : table = mxaliases where_field "select .. where" SQL. : where_field = alias additional_conditions SQL. : additional_conditions = AND status = 'paid' (SEE ALSO) postmap(1) Postfix postconf(5) ldap_table(5) LDAP mysql_table(5) MySQL sqlite_table(5) SQLite README (README FILES) "postconf readme_directory" "postconf html_directory" . DATABASE_README Postfix PGSQL_README PostgreSQL Postfix (LICENSE) (Secure Mailer license) . (HISTORY) PgSQL 2.1 Postfix . (AUTHORS) MySQL : Scott Cotton, Joshua Marcus IC Group, Inc. PostgreSQL : Aaron Sethman : Liviu Daia Institute of Mathematics of the Romanian Academy P.O. BOX 1-764 RO-014700 Bucharest, ROMANIA PGSQL_TABLE(5)