policydproxy

package module
v0.0.0-...-5c8867b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 18, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

README

postfix-policyd-proxy

A proxy for TCP-based Postfix policy services, that knows where to route the actual request based on the result of an LDAP query for the recipient.

The reason for the existence of this tool is that we don't know how to tell Postfix to combine a LDAP map as the check_policy_service backend.

Usage

The proxying behavior is controlled by a configuration file, in YAML format, which supports the following attributes:

  • not_found_action - (default: DUNNO) action to return to Postfix when the user is not found in the database
  • ldap
    • uri - connection string
    • bind_dn - bind DN, for authentication
    • bind_pw - bind password
    • base_dn - base DN for the lookup query
    • filter - filter for the lookup query
    • attr - result attribute for the lookup query
    • result_fmt - result format string to obtain the upstream host:port address, where the literal token %s is replaced by the value of the attr attribute

The LDAP parameters are pretty much all mandatory.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Director

type Director interface {
	Lookup(context.Context, string) (string, error)
}

A Director provides us with an upstream address (in host:port form), given a recipient email address.

func NewLDAPDirector

func NewLDAPDirector(uri, bindDN, bindPW, baseDN, filter, attr, resultFmt string) (Director, error)

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy implements the policyd-proxy service as a go-common/unix Handler. It understands the Postfix policy service protocol as documented on http://www.postfix.org/SMTPD_POLICY_README.html.

func NewProxy

func NewProxy(director Director, notFoundAction string) *Proxy

NewProxy creates a new Proxy with the specified Director.

func (*Proxy) ServeConnection

func (s *Proxy) ServeConnection(c net.Conn)

ServeConnection implements the Handler interface.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL