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