- Go 100%
| examples/static_lookup | Add static_lookup example | |
| .gitignore | gitignore editor files | |
| data.go | Add elaborate package documentation | |
| data_test.go | Add tests for data structures | |
| go.mod | Implement server tests and fix server initialisation | |
| go.sum | Implement server tests and fix server initialisation | |
| LICENSE | Define interface of socketmap library | |
| README.md | Give credits to sendmail | |
| server.go | Give credits to sendmail | |
| server_test.go | Implement server tests and fix server initialisation | |
Go implementation for Postfix' socketmap_table lookup protocol
Package socketmap implements Postfix' socketmap_table lookup protocol.
Background
The Postfix mail server uses lookup tables in various places, when it needs to translate some value into another. The most common use case is alias expansion for mail addresses.
While most tasks can be achieved using Postfix' built-in tables and flat files, sometimes, a more dynamic approach is needed. Therefore, Postfix can query external services using the socketmap_table protocol.
The protocol originates from sendmail, which should also be able to use services implemented using this library.
Implementing a lookup server
To implement a socketmap_table lookup server, only two things are needed:
- A lookup function which implements the lookup itself and returns a response
- A network listener to listen for Postfix' connections on
The source code repository has examples.
A single server can handle many different named maps, by registering different lookup functions.
Origin and maintenance
This package was written for the Bergblau component WebMilterd, which, among otehr functionality, resolves aliases by querying a REST API.
It is maintained by velocitux, which also offers commercial support for this lookup mechanism and for Postfix in general.
Special thanks to Claus Assmann for his proposal to use the socketmap_table.