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