dovecot

package
v0.0.0-...-63f23c4 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Shard    string                    `yaml:"shard"`
	Backend  *backend.Config           `yaml:"backend"`
	Keystore *clientutil.BackendConfig `yaml:"keystore"`

	// Set this to true if the keys obtained from the backend need
	// to be base64-encoded before being sent to Dovecot.
	Base64Encode bool `yaml:"base64_encode_results"`
}

Config for the dovecot-keystore daemon.

type DictDatabase

type DictDatabase interface {
	// Lookup a key. The result boolean is the presence flag, to
	// avoid having to check the object for nullness. Errors
	// result in failure being propagated upstream to Dovecot.
	Lookup(context.Context, string) (interface{}, bool, error)
}

DictDatabase is an interface to a key/value store by way of the Lookup method.

type DictProxyServer

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

DictProxyServer exposes a Database using the Dovecot dict proxy protocol (see https://doc.dovecot.org/developer_manual/design/dict_protocol/).

It implements the unix.LineHandler interface from the ai3/go-common/unix package.

func NewDictProxyServer

func NewDictProxyServer(db DictDatabase) *DictProxyServer

NewDictProxyServer creates a new DictProxyServer.

func (*DictProxyServer) ServeLine

func (p *DictProxyServer) ServeLine(ctx context.Context, lw unix.LineResponseWriter, line []byte) error

ServeLine handles a single command.

type KeyLookupProxy

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

KeyLookupProxy interfaces Dovecot with the user encryption key database.

func NewKeyLookupProxy

func NewKeyLookupProxy(config *Config) (*KeyLookupProxy, error)

NewKeyLookupProxy returns a KeyLookupProxy with the specified configuration.

func (*KeyLookupProxy) Lookup

func (s *KeyLookupProxy) Lookup(ctx context.Context, key string) (interface{}, bool, error)

Lookup a key using the dovecot dict proxy interface.

We can be sent a userdb lookup, or a passdb lookup, and we can tell them apart with the key prefix (passdb/ or userdb/).

Jump to

Keyboard shortcuts

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