dovecot

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package dovecot implements functions to interact with Dovecot's authentication service.

In particular, it supports doing user authorization, and checking if a user exists. It is a very basic implementation, with only the minimum needed to cover chasquid's needs.

https://wiki.dovecot.org/Design/AuthProtocol https://wiki.dovecot.org/Services#auth

Index

Constants

View Source
const DefaultTimeout = 5 * time.Second

DefaultTimeout to use. We expect Dovecot to be quite fast, but don't want to hang forever if something gets stuck.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {

	// Timeout for connection and I/O operations (applies on each call).
	// Set to DefaultTimeout by NewAuth.
	Timeout time.Duration
	// contains filtered or unexported fields
}

Auth represents a particular Dovecot auth service to use.

func NewAuth

func NewAuth(userdb, client string) *Auth

NewAuth returns a new connection against Dovecot authentication service. It takes the addresses of userdb and client sockets (usually paths as configured in dovecot).

func (*Auth) Authenticate

func (a *Auth) Authenticate(user, passwd string) (bool, error)

Authenticate returns true if the password is valid for the user, false otherwise.

func (*Auth) Check

func (a *Auth) Check() error

Check to see if this auth is functional.

func (*Auth) Exists

func (a *Auth) Exists(user string) (bool, error)

Exists returns true if the user exists, false otherwise.

func (*Auth) Reload

func (a *Auth) Reload() error

Reload the authenticator. It's a no-op for dovecot, but it is needed to conform with the auth.Backend interface.

func (*Auth) String

func (a *Auth) String() string

String representation of this Auth, for human consumption.

Jump to

Keyboard shortcuts

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