1<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN" 2 "http://www.w3.org/TR/html4/loose.dtd"> 3<html> <head> 4<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 5<link rel='stylesheet' type='text/css' href='postfix-doc.css'> 6<title> Postfix manual - tcp_table(5) </title> 7</head> <body> <pre> 8TCP_TABLE(5) TCP_TABLE(5) 9 10<b>NAME</b> 11 tcp_table - Postfix client/server table lookup protocol 12 13<b>SYNOPSIS</b> 14 <b>postmap -q "</b><i>string</i><b>" <a href="tcp_table.5.html">tcp</a>:</b><i>host:port</i> 15 16 <b>postmap -q - <a href="tcp_table.5.html">tcp</a>:</b><i>host:port</i> <<i>inputfile</i> 17 18<b>DESCRIPTION</b> 19 The Postfix mail system uses optional tables for address rewriting or 20 mail routing. These tables are usually in <b>dbm</b> or <b>db</b> format. Alterna- 21 tively, table lookups can be directed to a TCP server. 22 23 To find out what types of lookup tables your Postfix system supports 24 use the "<b>postconf -m</b>" command. 25 26 To test lookup tables, use the "<b>postmap -q</b>" command as described in the 27 SYNOPSIS above. 28 29<b>PROTOCOL DESCRIPTION</b> 30 The TCP map class implements a very simple protocol: the client sends a 31 request, and the server sends one reply. Requests and replies are sent 32 as one line of ASCII text, terminated by the ASCII newline character. 33 Request and reply parameters (see below) are separated by whitespace. 34 35 Send and receive operations must complete in 100 seconds. 36 37<b>REQUEST FORMAT</b> 38 The tcp_table protocol supports only the lookup request. The request 39 has the following form: 40 41 <b>get</b> SPACE <i>key</i> NEWLINE 42 Look up data under the specified key. 43 44 Postfix will not generate partial search keys such as domain names 45 without one or more subdomains, network addresses without one or more 46 least-significant octets, or email addresses without the localpart, 47 address extension or domain portion. This behavior is also found with 48 <a href="cidr_table.5.html">cidr</a>:, <a href="pcre_table.5.html">pcre</a>:, and <a href="regexp_table.5.html">regexp</a>: tables. 49 50<b>REPLY FORMAT</b> 51 Each reply specifies a status code and text. Replies must be no longer 52 than 4096 characters including the newline terminator. 53 54 <b>500</b> SPACE <i>text</i> NEWLINE 55 In case of a lookup request, the requested data does not exist. 56 The text describes the nature of the problem. 57 58 <b>400</b> SPACE <i>text</i> NEWLINE 59 This indicates an error condition. The text describes the nature 60 of the problem. The client should retry the request later. 61 62 <b>200</b> SPACE <i>text</i> NEWLINE 63 The request was successful. In the case of a lookup request, the 64 text contains an encoded version of the requested data. 65 66<b>ENCODING</b> 67 In request and reply parameters, the character %, each non-printing 68 character, and each whitespace character must be replaced by %XX, where 69 XX is the corresponding ASCII hexadecimal character value. The hexadec- 70 imal codes can be specified in any case (upper, lower, mixed). 71 72 The Postfix client always encodes a request. The server may omit the 73 encoding as long as the reply is guaranteed to not contain the % or 74 NEWLINE character. 75 76<b>SECURITY</b> 77 Do not use TCP lookup tables for security critical purposes. The 78 client-server connection is not protected and the server is not authen- 79 ticated. 80 81<b>BUGS</b> 82 Only the lookup method is currently implemented. 83 84 The client does not hang up when the connection is idle for a long 85 time. 86 87<b>SEE ALSO</b> 88 <a href="postmap.1.html">postmap(1)</a>, Postfix lookup table manager 89 <a href="regexp_table.5.html">regexp_table(5)</a>, format of regular expression tables 90 <a href="pcre_table.5.html">pcre_table(5)</a>, format of PCRE tables 91 <a href="cidr_table.5.html">cidr_table(5)</a>, format of CIDR tables 92 93<b>README FILES</b> 94 <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview 95 96<b>LICENSE</b> 97 The Secure Mailer license must be distributed with this software. 98 99<b>AUTHOR(S)</b> 100 Wietse Venema 101 IBM T.J. Watson Research 102 P.O. Box 704 103 Yorktown Heights, NY 10598, USA 104 105 Wietse Venema 106 Google, Inc. 107 111 8th Avenue 108 New York, NY 10011, USA 109 110 TCP_TABLE(5) 111</pre> </body> </html> 112