dovecot

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const DefaultAuthUserSocketPath = "/var/run/dovecot/auth-userdb"

DefaultAuthUserSocketPath is path to dovecot socket being used for authorization

View Source
const DefaultClientSocketPath = "/var/run/dovecot/auth-client"

DefaultClientSocketPath is path to dovecot socket being used for checking if recipient exists

View Source
const DefaultLMTPSocketPath = "/var/run/dovecot/lmtp"

DefaultLMTPSocketPath is path to dovecot socket which accepts email via LMTP protocol

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.

View Source
const RecipientOverrideFact = "DovecotRecipientOverrideFact"

RecipientOverrideFact is name of fact to store username being used for dovecot

Variables

This section is empty.

Functions

This section is empty.

Types

type Dovecot

type Dovecot struct {
	// PathToAuthUserDBSocket is path for dovecot socket being used in CheckRecipient command to check if recipient exists
	PathToAuthUserDBSocket string
	// PathToAuthClientSocket is path for dovecot socket being used in Authenticate command to check if sender
	// provided correct username and password
	PathToAuthClientSocket string

	// LmtpSocket is LMTP protocol socket for dovecot to accept email for local delivery
	LmtpSocket string

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

Dovecot represents a particular Dovecot auth service to use.

func (*Dovecot) Authenticate

func (d *Dovecot) Authenticate(tr *msmtpd.Transaction, user, passwd string) error

Authenticate performs authorization via AuthClientSocket of dovecot

func (*Dovecot) CheckRecipient

func (d *Dovecot) CheckRecipient(tr *msmtpd.Transaction, recipient *mail.Address) error

CheckRecipient returns true if the user exists, false otherwise.

func (*Dovecot) Deliver

func (d *Dovecot) Deliver(tr *msmtpd.Transaction) (err error)

Deliver actually delivers message into dovecot server LMTP socket

Jump to

Keyboard shortcuts

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