config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidRcpt       = errors.New("Test emails are not accepted for that inbox")
	ErrCantParseBody     = errors.New("Could not parse message body")
	ErrFromHeaderMissing = errors.New("<From:> header is missing")
	ErrFromHeaderInvalid = errors.New("<From:> header is invalid")
	ErrSPFCantValidate   = errors.New("SPF can not be validated")
	ErrDKIMCantValidate  = errors.New("DKIM can not be validated")
	ErrDMARCFailed       = errors.New("DMARC failed or sender could not be validated")
)

Uniform error messages used throughout the application

View Source
var RestrictInboxRegex *regexp.Regexp
View Source
var (
	TLSConfig *tls.Config
)

Functions

func LoadTLS

func LoadTLS()

Attempt to setup dynamic TLS configuration

Must be called AFTER the configuration was initialized.

Types

type Config

type Config struct {
	BindHost                string `yaml:"bind_host"`
	BindPort                int    `yaml:"bind_port"`
	TLSCertPath             string `yaml:"tls_cert_path,omitempty"`
	TLSKeyPath              string `yaml:"tls_key_path,omitempty"`
	TLSCacheDuration        int    `yaml:"tls_cache_duration,omitempty"`
	TLSCacheExpiryThreshold int    `yaml:"tls_cache_expiry_threshold,omitempty"`
	SMTPWelcomeMessage      string `yaml:"smtp_welcome_message"`
	ServerName              string `yaml:"server_name"`
	DeliveryPorts           []int  `yaml:"delivery_ports"`
	RestrictInbox           string `yaml:"restrict_inbox"`
	ForceSubjectPrefix      string `yaml:"force_subject_prefix"`
	MaxMessageSize          int    `yaml:"max_message_size"`
	EnableDmarc             bool   `yaml:"enable_dmarc"`
	ReplyAddress            string `yaml:"reply_address"`
	ReplyFrom               string `yaml:"reply_from"`
	ReplySubject            string `yaml:"reply_subject"`
	ReplyMessage            string `yaml:"reply_message"`
}
var Cnf Config

Current configuration of the application

func ReadConfig

func ReadConfig(path string) Config

Read and parse a yaml config at path

Jump to

Keyboard shortcuts

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