backend

package
v0.0.0-...-ac78394 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DispatchQueue

func DispatchQueue(q *MailQueue, c *config.Config, sm SendMail)

Types

type Backend

type Backend struct {
	Cfg   *config.Config
	Queue *MailQueue
}

func (*Backend) NewSession

func (b *Backend) NewSession(c *smtp.Conn) (smtp.Session, error)

type Mail

type Mail struct {
	From     string
	To       []string
	Headers  map[string]string
	Body     string
	MailData []byte
}

func (*Mail) GetCharset

func (m *Mail) GetCharset() string

func (*Mail) GetDestList

func (m *Mail) GetDestList() []*string

func (*Mail) GetSubject

func (m *Mail) GetSubject() string

type MailQueue

type MailQueue struct {
	Mu sync.Mutex
	M  chan Mail
}

type SendMail

type SendMail func(m *Mail, c *config.Config) error

type Session

type Session struct {
	Cfg      *config.Config
	Queue    *MailQueue
	IsAuthed bool
	AuthUser string
	Current  Mail
}

func (*Session) AuthPlain

func (s *Session) AuthPlain(username string, password string) error

func (*Session) Data

func (s *Session) Data(r io.Reader) error

func (*Session) EnqueueMail

func (s *Session) EnqueueMail(mail *Mail)

func (*Session) Logout

func (s *Session) Logout() error

func (*Session) Mail

func (s *Session) Mail(from string, opts *smtp.MailOptions) error

func (*Session) Rcpt

func (s *Session) Rcpt(to string, opts *smtp.RcptOptions) error

func (*Session) Reset

func (s *Session) Reset()

Jump to

Keyboard shortcuts

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