TCP_TABLE(5)
π¦ NAME π¦
tcp_table β the Postfix client/server table lookup protocol, bestie π
β¨ SYNOPSIS β¨
postmap -q "string" tcp:host:port
postmap -q - tcp:host:port <inputfile
πΈ DESCRIPTION πΈ
okay so, the Postfix mail system uses optional tables for address rewriting or mail routing, right? and those tables are usually in lmdb:, cdb:, hash:, or dbm: format. classic. iconic. we love her.
but alternatively β plot twist β table lookups can be directed to a TCP server instead π. and to test lookup tables, you use the "postmap -q" command, exactly like it says up in the SYNOPSIS. iykyk π«Ά
π PROTOCOL DESCRIPTION π
the TCP map class implements a very simple protocol: the client sends a request, and the server sends one reply. that's it. one in, one out. the way that it just works ππ
requests and replies are sent as one line of ASCII text, terminated by the ASCII newline character. request and reply parameters (see below, bestie) are separated by whitespace.
β° send and receive operations must complete in 100 seconds. no dawdling. main character energy only.
π₯ REQUEST FORMAT π₯
the tcp_table protocol supports only the lookup request. the request has the following form:
get SPACE key NEWLINEβ look up data under the specified key π
not me about to tell you the wild part: Postfix will not generate partial search keys like domain names without one or more subdomains, network addresses without one or more least-significant octets, or email addresses without the localpart, address extension or domain portion. this behavior is also found with cidr:, pcre:, and regexp: tables β¨ so it's a whole family vibe.
π REPLY FORMAT π
each reply specifies a status code and text. and bestie, listen β replies must be no longer than 4096 characters including the newline terminator. keep it tight π
500 SPACE text NEWLINEβ in case of a lookup request, the requested data does not exist. the text describes the nature of the problem π400 SPACE text NEWLINEβ this indicates an error condition. the text describes the nature of the problem. the client should retry the request later π200 SPACE text NEWLINEβ the request was successful π in the case of a lookup request, the text contains an encoded version of the requested data.
π ENCODING π
in request and reply parameters, the character %, each non-printing character, and each whitespace character must be replaced by %XX, where XX is the corresponding ASCII hexadecimal character value. the hexadecimal codes can be specified in any case (upper, lower, mixed) β she's flexible like that π
the Postfix client always encodes a request. the server may omit the encoding as long as the reply is guaranteed to not contain the % or NEWLINE character. slay π§
β οΈ SECURITY β οΈ
π¨ do not use TCP lookup tables for security critical purposes. the client-server connection is not protected and the server is not authenticated. fr fr. this is not the vibe for anything that actually matters. π
π BUGS π
- only the lookup method is currently implemented.
- the client does not hang up when the connection is idle for a long time. she's loyal. she's waiting. she's not leaving π₯²
π SEE ALSO π
postmap(1), Postfix lookup table managerregexp_table(5), format of regular expression tablespcre_table(5), format of PCRE tablescidr_table(5), format of CIDR tables
π README FILES π
use "postconf readme_directory" or "postconf html_directory" to locate this information.
DATABASE_README, Postfix lookup table overview
π LICENSE π
The Secure Mailer license must be distributed with this software.
π«Ά AUTHOR(S) π«Ά
Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA
Wietse Venema Google, Inc. 111 8th Avenue New York, NY 10011, USA
and that's the whole page, bestie π it lives in the File Formats Manual and it's literally called tcp_table(5) β go forth and look up your keys β¨ππ¦
π¦ where this page comes from
- alpine 3.24: postfix-doc 3.11.7-r0 Β· IPL-1.0 EPL-2.0
- arch rolling: postfix 3.11.7-1 Β· EPL-2.0 OR IPL-1.0 AND BSD-4-Clause-UC
- nixos 26.05: postfix 3.11.7
- nixpkgs unstable: postfix 3.11.7
- ubuntu stonking: postfix 3.11.7-1ubuntu2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms