Documentation
¶
Overview ¶
Package pop3 implements a minimal POP3 server, mostly intended to be ran over the loopback interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInUse is the error returned by a Backend if a user's maildrop is // already in use by another session. ErrInUse = errors.New("[IN-USE] Do you have another POP session running?") // ErrBackendFail is the error returned by a Backend if a user's maildrop // can't be acquired due to an internal error. ErrBackendFail = errors.New("[BACKEND-FAIL] Internal error in backend.") )
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface {
// NewSession authenticates the user specified by the given username and
// password, and iff the the credentials are valid, locks the user's
// maildrop and returns a BackendSession instance.
NewSession(user, pass []byte) (BackendSession, error)
}
Backend is the common interface exposed by a storage backend.
type BackendSession ¶
type BackendSession interface {
// Messages returns all of the messages in a user's maildrop.
Messages() ([][]byte, error)
// DeleteMessages deletes all of the specified messages, addressed by
// index into the slice returned by Messages().
DeleteMessages([]int) error
// Close unlocks the user's maildrop and tears down the BackendSession.
Close()
}
BackendSession is a view into a given user's (locked) maildrop.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is a POP3 server session.
func NewSession ¶
NewSession creates a new Session, bound to the provided net.Conn, to be serviced via the provided Backend.
Click to show internal directories.
Click to hide internal directories.