smtp

package
v0.0.0-...-90a255e Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AllowAnonymous bool = false
	Relay          *RelayConfig
)

Functions

func Start

func Start(domain string, port int, tlsCA string, tlsCrt string, tlsKey string, allowInsecureAuth bool, smtpUtf8 bool, requireTls bool, binaryMime bool) error

Types

type Backend

type Backend struct{}

The Backend implements SMTP server methods.

func (*Backend) AnonymousLogin

func (bkd *Backend) AnonymousLogin(state *smtp.ConnectionState) (smtp.Session, error)

AnonymousLogin requires clients to authenticate using SMTP AUTH before sending emails

func (*Backend) Login

func (bkd *Backend) Login(state *smtp.ConnectionState, username, password string) (smtp.Session, error)

Login handles a login command with username and password.

type RelayConfig

type RelayConfig struct {
	Host                  string
	Port                  int
	User                  string
	Pass                  string
	From                  string
	TLSEnable             bool
	TLSInsecureSkipVerify bool
	TLSCa                 string
	TLSCrt                string
	TLSKey                string
	RequireTLS            bool
	UTF8                  bool
	BinaryMime            bool
}

type Session

type Session struct {
	ProviderName string
	From         string
	To           []string
}

A Session is returned after successful login.

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

func (e *Session) RelaySend(r io.Reader) 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