141fbaed0Stron#++ 241fbaed0Stron# NAME 341fbaed0Stron# tcp_table 5 441fbaed0Stron# SUMMARY 541fbaed0Stron# Postfix client/server table lookup protocol 641fbaed0Stron# SYNOPSIS 741fbaed0Stron# \fBpostmap -q "\fIstring\fB" tcp:\fIhost:port\fR 841fbaed0Stron# 916d67a18Stron# \fBpostmap -q - tcp:\fIhost:port\fB <\fIinputfile\fR 1041fbaed0Stron# DESCRIPTION 1141fbaed0Stron# The Postfix mail system uses optional tables for address 1241fbaed0Stron# rewriting or mail routing. These tables are usually in 1341fbaed0Stron# \fBdbm\fR or \fBdb\fR format. Alternatively, table lookups 1441fbaed0Stron# can be directed to a TCP server. 1541fbaed0Stron# 1641fbaed0Stron# To find out what types of lookup tables your Postfix system 1741fbaed0Stron# supports use the "\fBpostconf -m\fR" command. 1841fbaed0Stron# 1941fbaed0Stron# To test lookup tables, use the "\fBpostmap -q\fR" command as 2041fbaed0Stron# described in the SYNOPSIS above. 2141fbaed0Stron# PROTOCOL DESCRIPTION 2241fbaed0Stron# .ad 2341fbaed0Stron# .fi 2441fbaed0Stron# The TCP map class implements a very simple protocol: the client 2541fbaed0Stron# sends a request, and the server sends one reply. Requests and 2641fbaed0Stron# replies are sent as one line of ASCII text, terminated by the 2741fbaed0Stron# ASCII newline character. Request and reply parameters (see below) 2841fbaed0Stron# are separated by whitespace. 2941fbaed0Stron# 3041fbaed0Stron# Send and receive operations must complete in 100 seconds. 3141fbaed0Stron# REQUEST FORMAT 3241fbaed0Stron# .ad 3341fbaed0Stron# .fi 34*f3bc92a4Schristos# The tcp_table protocol supports only the lookup request. 35*f3bc92a4Schristos# The request has the following form: 3641fbaed0Stron# .IP "\fBget\fR SPACE \fIkey\fR NEWLINE" 3741fbaed0Stron# Look up data under the specified key. 38*f3bc92a4Schristos# .PP 39*f3bc92a4Schristos# Postfix will not generate partial search keys such as domain 40*f3bc92a4Schristos# names without one or more subdomains, network addresses 41*f3bc92a4Schristos# without one or more least-significant octets, or email 42*f3bc92a4Schristos# addresses without the localpart, address extension or domain 43*f3bc92a4Schristos# portion. This behavior is also found with cidr:, pcre:, and 44*f3bc92a4Schristos# regexp: tables. 4541fbaed0Stron# REPLY FORMAT 4641fbaed0Stron# .ad 4741fbaed0Stron# .fi 4841fbaed0Stron# Each reply specifies a status code and text. Replies must be no 4941fbaed0Stron# longer than 4096 characters including the newline terminator. 5041fbaed0Stron# .IP "\fB500\fR SPACE \fItext\fR NEWLINE" 5141fbaed0Stron# In case of a lookup request, the requested data does not exist. 5241fbaed0Stron# The text describes the nature of the problem. 5341fbaed0Stron# .IP "\fB400\fR SPACE \fItext\fR NEWLINE" 5441fbaed0Stron# This indicates an error condition. The text describes the nature of 5541fbaed0Stron# the problem. The client should retry the request later. 5641fbaed0Stron# .IP "\fB200\fR SPACE \fItext\fR NEWLINE" 5741fbaed0Stron# The request was successful. In the case of a lookup request, 5841fbaed0Stron# the text contains an encoded version of the requested data. 5941fbaed0Stron# ENCODING 6041fbaed0Stron# .ad 6141fbaed0Stron# .fi 6241fbaed0Stron# In request and reply parameters, the character %, each non-printing 6341fbaed0Stron# character, and each whitespace character must be replaced by %XX, 6441fbaed0Stron# where XX is the corresponding ASCII hexadecimal character value. The 6541fbaed0Stron# hexadecimal codes can be specified in any case (upper, lower, mixed). 6641fbaed0Stron# 6741fbaed0Stron# The Postfix client always encodes a request. 6841fbaed0Stron# The server may omit the encoding as long as the reply 6941fbaed0Stron# is guaranteed to not contain the % or NEWLINE character. 7041fbaed0Stron# SECURITY 7141fbaed0Stron# .ad 7241fbaed0Stron# .fi 7341fbaed0Stron# Do not use TCP lookup tables for security critical purposes. 7441fbaed0Stron# The client-server connection is not protected and the server 7541fbaed0Stron# is not authenticated. 7641fbaed0Stron# BUGS 7741fbaed0Stron# Only the lookup method is currently implemented. 7841fbaed0Stron# 7941fbaed0Stron# The client does not hang up when the connection is idle for 8041fbaed0Stron# a long time. 8141fbaed0Stron# SEE ALSO 8241fbaed0Stron# postmap(1), Postfix lookup table manager 8341fbaed0Stron# regexp_table(5), format of regular expression tables 8441fbaed0Stron# pcre_table(5), format of PCRE tables 8541fbaed0Stron# cidr_table(5), format of CIDR tables 8641fbaed0Stron# README FILES 8741fbaed0Stron# .ad 8841fbaed0Stron# .fi 8941fbaed0Stron# Use "\fBpostconf readme_directory\fR" or 9041fbaed0Stron# "\fBpostconf html_directory\fR" to locate this information. 9141fbaed0Stron# .na 9241fbaed0Stron# .nf 9341fbaed0Stron# DATABASE_README, Postfix lookup table overview 9441fbaed0Stron# LICENSE 9541fbaed0Stron# .ad 9641fbaed0Stron# .fi 9741fbaed0Stron# The Secure Mailer license must be distributed with this software. 9841fbaed0Stron# AUTHOR(S) 9941fbaed0Stron# Wietse Venema 10041fbaed0Stron# IBM T.J. Watson Research 10141fbaed0Stron# P.O. Box 704 10241fbaed0Stron# Yorktown Heights, NY 10598, USA 103e262b48eSchristos# 104e262b48eSchristos# Wietse Venema 105e262b48eSchristos# Google, Inc. 106e262b48eSchristos# 111 8th Avenue 107e262b48eSchristos# New York, NY 10011, USA 10841fbaed0Stron#--*/ 109