# info > socketmap_table

---
type: CommandReference
command: socketmap_table
mode: man
section: 5
source: man-pages
---

## Quick Reference

- `postmap -q "string" socketmap:inet:host:port:name` — Lookup a key via TCP socketmap
- `postmap -q "string" socketmap:unix:pathname:name` — Lookup a key via Unix-domain socketmap
- `postmap -q - socketmap:inet:host:port:name < inputfile` — Batch lookup from stdin
- `postmap -q - socketmap:unix:pathname:name < inputfile` — Batch lookup from stdin (Unix socket)

## Name

Postfix socketmap table lookup client

## Synopsis

postmap -q "string" socketmap:inet:host:port:name
postmap -q "string" socketmap:unix:pathname:name

postmap -q - socketmap:inet:host:port:name < inputfile
postmap -q - socketmap:unix:pathname:name < inputfile
## Protocol

Socketmaps use a simple protocol: the client sends one request, and the server sends one reply. Each request and each reply are sent as one netstring object.

**Request format**

The socketmap protocol supports only the lookup request:

name <space> key
Search the named socketmap for the specified key.

Postfix will not generate partial search keys (e.g., truncated domain names, network addresses, or email addresses).

**Reply format**

Replies must not exceed 100,000 characters (not including netstring encapsulation). Forms:

- `OK <space> data` — The requested data was found.
- `NOTFOUND <space>` — The requested data was not found.
- `TEMP <space> reason` — Temporary failure.
- `TIMEOUT <space> reason` — Timeout.
- `PERM <space> reason` — Permanent failure.

## Examples

shell
postmap -q "user@example.com" socketmap:inet:127.0.0.1:12345:my_map
postmap -q "user@example.com" socketmap:unix:/var/run/socketmap.sock:my_map
## See Also

- [netstring definition](http://cr.yp.to/proto/netstrings.txt)
- [postconf(1)](http://localhost/phpMan.php/man/postconf/1/markdown) — Postfix supported lookup tables
- [postmap(1)](http://localhost/phpMan.php/man/postmap/1/markdown) — Postfix lookup table manager
- [regexp_table(5)](http://localhost/phpMan.php/man/regexptable/5/markdown) — format of regular expression tables
- [pcre_table(5)](http://localhost/phpMan.php/man/pcretable/5/markdown) — format of PCRE tables
- [cidr_table(5)](http://localhost/phpMan.php/man/cidrtable/5/markdown) — format of CIDR tables