Documentation
¶
Overview ¶
Package dovecot implements functions to interact with Dovecot's authentication service.
Index ¶
Constants ¶
const DefaultAuthUserSocketPath = "/var/run/dovecot/auth-userdb"
DefaultAuthUserSocketPath is path to dovecot socket being used for authorization
const DefaultClientSocketPath = "/var/run/dovecot/auth-client"
DefaultClientSocketPath is path to dovecot socket being used for checking if recipient exists
const DefaultLMTPSocketPath = "/var/run/dovecot/lmtp"
DefaultLMTPSocketPath is path to dovecot socket which accepts email via LMTP protocol
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.
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 ¶
CheckRecipient returns true if the user exists, false otherwise.