smtp

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Plain = "PLAIN"
	Login = "LOGIN"
)

Variables

View Source
var AuthTypes = []string{Plain, Login}

Functions

func NewProvider

func NewProvider(cfg *Config) auth.Provider

NewProvider creates a new SMTP authentication provider.

Types

type Config

type Config struct {
	Auth           string
	Host           string
	Port           int
	AllowedDomains string
	TLS            bool `ini:"tls"`
	SkipVerify     bool
}

Config contains configuration for SMTP authentication.

⚠️ WARNING: Change to the field name must preserve the INI key name for backward compatibility.

type Provider

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

Provider contains configuration of an SMTP authentication provider.

func (*Provider) Authenticate

func (p *Provider) Authenticate(login, password string) (*auth.ExternalAccount, error)

Authenticate queries if login/password is valid against the SMTP server, and returns queried information when succeeded.

func (*Provider) Config

func (p *Provider) Config() any

func (*Provider) HasTLS

func (*Provider) HasTLS() bool

func (*Provider) SkipTLSVerify

func (p *Provider) SkipTLSVerify() bool

func (*Provider) UseTLS

func (p *Provider) UseTLS() bool

Jump to

Keyboard shortcuts

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