1 1.1 tron #++ 2 1.1 tron # NAME 3 1.1 tron # tcp_table 5 4 1.1 tron # SUMMARY 5 1.1 tron # Postfix client/server table lookup protocol 6 1.1 tron # SYNOPSIS 7 1.1 tron # \fBpostmap -q "\fIstring\fB" tcp:\fIhost:port\fR 8 1.1 tron # 9 1.1.1.2 tron # \fBpostmap -q - tcp:\fIhost:port\fB <\fIinputfile\fR 10 1.1 tron # DESCRIPTION 11 1.1.1.4 christos # The Postfix mail system uses optional tables for address 12 1.1.1.4 christos # rewriting or mail routing. These tables are usually in 13 1.1.1.5 christos # \fBlmdb:\fR, \fBcdb:\fR, \fBhash:\fR, or \fBdbm:\fR format. 14 1.1 tron # 15 1.1.1.5 christos # Alternatively, table lookups can be directed to a TCP server. 16 1.1.1.4 christos # To test lookup tables, use the "\fBpostmap -q\fR" command as 17 1.1.1.4 christos # described in the SYNOPSIS above. 18 1.1 tron # PROTOCOL DESCRIPTION 19 1.1 tron # .ad 20 1.1 tron # .fi 21 1.1 tron # The TCP map class implements a very simple protocol: the client 22 1.1 tron # sends a request, and the server sends one reply. Requests and 23 1.1 tron # replies are sent as one line of ASCII text, terminated by the 24 1.1 tron # ASCII newline character. Request and reply parameters (see below) 25 1.1 tron # are separated by whitespace. 26 1.1 tron # 27 1.1 tron # Send and receive operations must complete in 100 seconds. 28 1.1 tron # REQUEST FORMAT 29 1.1 tron # .ad 30 1.1 tron # .fi 31 1.1.1.4 christos # The tcp_table protocol supports only the lookup request. 32 1.1.1.4 christos # The request has the following form: 33 1.1 tron # .IP "\fBget\fR SPACE \fIkey\fR NEWLINE" 34 1.1 tron # Look up data under the specified key. 35 1.1.1.4 christos # .PP 36 1.1.1.4 christos # Postfix will not generate partial search keys such as domain 37 1.1.1.4 christos # names without one or more subdomains, network addresses 38 1.1.1.4 christos # without one or more least-significant octets, or email 39 1.1.1.4 christos # addresses without the localpart, address extension or domain 40 1.1.1.4 christos # portion. This behavior is also found with cidr:, pcre:, and 41 1.1.1.4 christos # regexp: tables. 42 1.1 tron # REPLY FORMAT 43 1.1 tron # .ad 44 1.1 tron # .fi 45 1.1 tron # Each reply specifies a status code and text. Replies must be no 46 1.1 tron # longer than 4096 characters including the newline terminator. 47 1.1 tron # .IP "\fB500\fR SPACE \fItext\fR NEWLINE" 48 1.1 tron # In case of a lookup request, the requested data does not exist. 49 1.1 tron # The text describes the nature of the problem. 50 1.1 tron # .IP "\fB400\fR SPACE \fItext\fR NEWLINE" 51 1.1 tron # This indicates an error condition. The text describes the nature of 52 1.1 tron # the problem. The client should retry the request later. 53 1.1 tron # .IP "\fB200\fR SPACE \fItext\fR NEWLINE" 54 1.1 tron # The request was successful. In the case of a lookup request, 55 1.1 tron # the text contains an encoded version of the requested data. 56 1.1 tron # ENCODING 57 1.1 tron # .ad 58 1.1 tron # .fi 59 1.1 tron # In request and reply parameters, the character %, each non-printing 60 1.1 tron # character, and each whitespace character must be replaced by %XX, 61 1.1 tron # where XX is the corresponding ASCII hexadecimal character value. The 62 1.1 tron # hexadecimal codes can be specified in any case (upper, lower, mixed). 63 1.1 tron # 64 1.1 tron # The Postfix client always encodes a request. 65 1.1 tron # The server may omit the encoding as long as the reply 66 1.1 tron # is guaranteed to not contain the % or NEWLINE character. 67 1.1 tron # SECURITY 68 1.1 tron # .ad 69 1.1 tron # .fi 70 1.1 tron # Do not use TCP lookup tables for security critical purposes. 71 1.1 tron # The client-server connection is not protected and the server 72 1.1 tron # is not authenticated. 73 1.1 tron # BUGS 74 1.1 tron # Only the lookup method is currently implemented. 75 1.1 tron # 76 1.1 tron # The client does not hang up when the connection is idle for 77 1.1 tron # a long time. 78 1.1 tron # SEE ALSO 79 1.1 tron # postmap(1), Postfix lookup table manager 80 1.1 tron # regexp_table(5), format of regular expression tables 81 1.1 tron # pcre_table(5), format of PCRE tables 82 1.1 tron # cidr_table(5), format of CIDR tables 83 1.1 tron # README FILES 84 1.1 tron # .ad 85 1.1 tron # .fi 86 1.1 tron # Use "\fBpostconf readme_directory\fR" or 87 1.1 tron # "\fBpostconf html_directory\fR" to locate this information. 88 1.1 tron # .na 89 1.1 tron # .nf 90 1.1 tron # DATABASE_README, Postfix lookup table overview 91 1.1 tron # LICENSE 92 1.1 tron # .ad 93 1.1 tron # .fi 94 1.1 tron # The Secure Mailer license must be distributed with this software. 95 1.1 tron # AUTHOR(S) 96 1.1 tron # Wietse Venema 97 1.1 tron # IBM T.J. Watson Research 98 1.1 tron # P.O. Box 704 99 1.1 tron # Yorktown Heights, NY 10598, USA 100 1.1.1.3 christos # 101 1.1.1.3 christos # Wietse Venema 102 1.1.1.3 christos # Google, Inc. 103 1.1.1.3 christos # 111 8th Avenue 104 1.1.1.3 christos # New York, NY 10011, USA 105 1.1 tron #--*/ 106