smtp

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: AGPL-3.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthNormal added in v1.2.8

func AuthNormal(addr string, auth *common.Auth) error

func AuthTls added in v1.2.8

func AuthTls(addr string, auth *common.Auth, tls *tls.Config) error

func SendMailTls added in v1.2.8

func SendMailTls(addr string, auth common.Auth, env *BEnvelope, tls *tls.Config) error

Types

type BEnvelope

type BEnvelope struct {
	From    string
	StampID string
	Tos     []string
	Stamp   comm.StampData
	Data    io.Reader
}

func (*BEnvelope) WriteTo

func (env *BEnvelope) WriteTo(w io.Writer) (n int64, err error)

type Conf

type Conf struct {
	SrvAddr         string                 `json:"srv_addr"`
	SrvDomain       string                 `json:"srv_domain"`
	StampWalletAddr string                 `json:"stamp_wallet_addr"`
	RemoteConf      map[string]*RemoteConf `json:"remote_conf"`
	MaxMessageBytes int                    `json:"max_message_bytes"`
	ReadTimeOut     int                    `json:"read_time_out"`
	WriteTimeOut    int                    `json:"write_time_out"`
	MaxRecipients   int                    `json:"max_recipients"`
}

func (*Conf) String

func (sc *Conf) String() string

type Delegate

type Delegate interface {
	SendMail(auth common.Auth, env *BEnvelope) error
	AUTH(auth *common.Auth) error
}

type RemoteConf

type RemoteConf struct {
	RemoteSrvCAs    string `json:"ca_files"`
	RemoteCADomain  string `json:"ca_domain"`
	AllowNotSecure  bool   `json:"allow_not_secure"`
	RemoteSrvName   string `json:"remote_srv_name"`
	RemoteSrvPort   int    `json:"remote_srv_port"`
	ActiveStampAddr string `json:"active_stamp_addr"`
	// contains filtered or unexported fields
}

func (*RemoteConf) String

func (rc *RemoteConf) String() string

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewSMTPSrv

func NewSMTPSrv(conf *Conf, lclSrvTls *tls.Config) (*Service, error)

func (*Service) AUTH

func (ss *Service) AUTH(auth *common.Auth) error

func (*Service) NewSession

func (ss *Service) NewSession(_ *smtp.Conn) (smtp.Session, error)

func (*Service) SendMail

func (ss *Service) SendMail(auth common.Auth, env *BEnvelope) error

func (*Service) Start

func (ss *Service) Start(sig chan struct{}) error

func (*Service) StartWithCtx added in v1.2.2

func (ss *Service) StartWithCtx(cancel context.CancelFunc) error

func (*Service) Stop added in v1.2.2

func (ss *Service) Stop()

type Session

type Session struct {
	// contains filtered or unexported fields
}

func (*Session) AuthPlain

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

func (*Session) Data

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

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) 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