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=us-ascii"> 5<title> Postfix manual - tcp_table(5) </title> 6</head> <body> <pre> 7TCP_TABLE(5) TCP_TABLE(5) 8 9<b>NAME</b> 10 tcp_table - Postfix client/server table lookup protocol 11 12<b>SYNOPSIS</b> 13 <b>postmap -q "</b><i>string</i><b>" <a href="tcp_table.5.html">tcp</a>:</b><i>host:port</i> 14 15 <b>postmap -q - <a href="tcp_table.5.html">tcp</a>:</b><i>host:port</i> <<i>inputfile</i> 16 17<b>DESCRIPTION</b> 18 The Postfix mail system uses optional tables for address 19 rewriting or mail routing. These tables are usually in <b>dbm</b> 20 or <b>db</b> format. Alternatively, table lookups can be directed 21 to a TCP server. 22 23 To find out what types of lookup tables your Postfix sys- 24 tem supports use the "<b>postconf -m</b>" command. 25 26 To test lookup tables, use the "<b>postmap -q</b>" command as 27 described in the SYNOPSIS above. 28 29<b>PROTOCOL DESCRIPTION</b> 30 The TCP map class implements a very simple protocol: the 31 client sends a request, and the server sends one reply. 32 Requests and replies are sent as one line of ASCII text, 33 terminated by the ASCII newline character. Request and 34 reply parameters (see below) are separated by whitespace. 35 36 Send and receive operations must complete in 100 seconds. 37 38<b>REQUEST FORMAT</b> 39 Each request specifies a command, a lookup key, and possi- 40 bly a lookup result. 41 42 <b>get</b> SPACE <i>key</i> NEWLINE 43 Look up data under the specified key. 44 45 <b>put</b> SPACE <i>key</i> SPACE <i>value</i> NEWLINE 46 This request is currently not implemented. 47 48<b>REPLY FORMAT</b> 49 Each reply specifies a status code and text. Replies must 50 be no longer than 4096 characters including the newline 51 terminator. 52 53 <b>500</b> SPACE <i>text</i> NEWLINE 54 In case of a lookup request, the requested data 55 does not exist. In case of an update request, the 56 request was rejected. The text describes the 57 nature of the problem. 58 59 <b>400</b> SPACE <i>text</i> NEWLINE 60 This indicates an error condition. The text 61 describes the nature of the problem. The client 62 should retry the request later. 63 64 <b>200</b> SPACE <i>text</i> NEWLINE 65 The request was successful. In the case of a lookup 66 request, the text contains an encoded version of 67 the requested data. 68 69<b>ENCODING</b> 70 In request and reply parameters, the character %, each 71 non-printing character, and each whitespace character must 72 be replaced by %XX, where XX is the corresponding ASCII 73 hexadecimal character value. The hexadecimal codes can be 74 specified in any case (upper, lower, mixed). 75 76 The Postfix client always encodes a request. The server 77 may omit the encoding as long as the reply is guaranteed 78 to not contain the % or NEWLINE character. 79 80<b>SECURITY</b> 81 Do not use TCP lookup tables for security critical pur- 82 poses. The client-server connection is not protected and 83 the server is not authenticated. 84 85<b>BUGS</b> 86 Only the lookup method is currently implemented. 87 88 The client does not hang up when the connection is idle 89 for a long time. 90 91<b>SEE ALSO</b> 92 <a href="postmap.1.html">postmap(1)</a>, Postfix lookup table manager 93 <a href="regexp_table.5.html">regexp_table(5)</a>, format of regular expression tables 94 <a href="pcre_table.5.html">pcre_table(5)</a>, format of PCRE tables 95 <a href="cidr_table.5.html">cidr_table(5)</a>, format of CIDR tables 96 97<b>README FILES</b> 98 <a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview 99 100<b>LICENSE</b> 101 The Secure Mailer license must be distributed with this 102 software. 103 104<b>AUTHOR(S)</b> 105 Wietse Venema 106 IBM T.J. Watson Research 107 P.O. Box 704 108 Yorktown Heights, NY 10598, USA 109 110 TCP_TABLE(5) 111</pre> </body> </html> 112