smtp

package
v3.6.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: GPL-3.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidRecipient = errors.New("invalid recipient")
View Source
var ErrInvalidReturnPath = errors.New("invalid return path")
View Source
var ErrNoSuchUser = errors.New("no such user")

Functions

This section is empty.

Types

type Accounts

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

func NewAccounts

func NewAccounts() *Accounts

func (*Accounts) AddAccount

func (s *Accounts) AddAccount(account *Service)

func (*Accounts) CheckAuth

func (s *Accounts) CheckAuth(user string, password []byte) (string, string, error)

func (*Accounts) RemoveAccount

func (s *Accounts) RemoveAccount(account *Service)

func (*Accounts) SendMail

func (s *Accounts) SendMail(ctx context.Context, userID, addrID, from string, to []string, r io.Reader) error

type Backend

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

func NewBackend

func NewBackend(accounts *Accounts, userAgent identifier.UserAgentUpdater) *Backend

func (*Backend) NewSession

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

type NullServerManager

type NullServerManager struct{}

func NewNullServerManager

func NewNullServerManager() *NullServerManager

func (NullServerManager) AddSMTPAccount

func (n NullServerManager) AddSMTPAccount(_ context.Context, _ *Service) error

func (NullServerManager) RemoveSMTPAccount

func (n NullServerManager) RemoveSMTPAccount(_ context.Context, _ *Service) error

type ServerManager

type ServerManager interface {
	AddSMTPAccount(ctx context.Context, service *Service) error
	RemoveSMTPAccount(ctx context.Context, service *Service) error
}

type Service

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

func NewService

func NewService(
	userID string,
	client *proton.Client,
	recorder *sendrecorder.SendRecorder,
	handler async.PanicHandler,
	reporter reporter.Reporter,
	bridgePassProvider useridentity.BridgePassProvider,
	keyPassProvider useridentity.KeyPassProvider,
	telemetry Telemetry,
	eventService userevents.Subscribable,
	mode usertypes.AddressMode,
	identityState *useridentity.State,
	serverManager ServerManager,
) *Service

func (*Service) HandleAddressEvents

func (s *Service) HandleAddressEvents(_ context.Context, events []proton.AddressEvent) error

func (*Service) HandleRefreshEvent

func (s *Service) HandleRefreshEvent(ctx context.Context, _ proton.RefreshFlag) error

func (*Service) HandleUserEvent

func (s *Service) HandleUserEvent(_ context.Context, user *proton.User) error

func (*Service) OnLogout

func (s *Service) OnLogout(ctx context.Context) error

func (*Service) Resync

func (s *Service) Resync(ctx context.Context) error

func (*Service) SendMail

func (s *Service) SendMail(ctx context.Context, authID string, from string, to []string, r io.Reader) error

func (*Service) SetAddressMode

func (s *Service) SetAddressMode(ctx context.Context, mode usertypes.AddressMode) error

func (*Service) Start

func (*Service) UserID

func (s *Service) UserID() string

type Telemetry

type Telemetry interface {
	useridentity.Telemetry
	ReportSMTPAuthSuccess(context.Context)
	ReportSMTPAuthFailed(username string)
}

Jump to

Keyboard shortcuts

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