config

package
v0.0.0-...-88fb584 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SaveConfig

func SaveConfig(path string, config *RawConfig) error

Types

type ParsedConfig

type ParsedConfig struct {
	RawConfig
	ForwardMapping map[string][]*mail.Address
}

func LoadAndParseConfig

func LoadAndParseConfig(path string) (*ParsedConfig, error)

func ParseConfig

func ParseConfig(config *RawConfig) (*ParsedConfig, error)

type RawConfig

type RawConfig struct {
	FromEmail      string              `json:"fromEmail"`      // Email address the From header will be overwritten to (if specified)
	ToEmail        string              `json:"toEmail"`        // Email address the To header will be overwritten to (if specified)
	SubjectPrefix  string              `json:"subjectPrefix"`  // A prefix that will be added to the Subject header (if specified)
	AllowPlusSign  bool                `json:"allowPlusSign"`  // Allow "+" (plus) sign in recipient addresses (part after "+" will be removed)
	ForwardMapping map[string][]string `json:"forwardMapping"` // Mapping of incoming recipients to forwarded recipients
	S3             S3Config            `json:"s3"`
}

Forwarder configuration

func LoadConfig

func LoadConfig(path string) (*RawConfig, error)

type S3Config

type S3Config struct {
	BucketName string           `json:"bucketName"` // Name of the S3 bucket
	Incoming   S3IncomingConfig `json:"incoming"`
	Outgoing   S3OutgoingConfig `json:"outgoing"`
}

AWS S3 configuration

type S3IncomingConfig

type S3IncomingConfig struct {
	NewPrefix       string `json:"newPrefix"`       // Prefix (directory) where new messages received by SES are expected to be stored
	SpamVirusPrefix string `json:"spamVirusPrefix"` // Prefix (directory) for messages that were flagged as spam or/and virus
	ForwardedPrefix string `json:"forwardedPrefix"` // Prefix (directory) for messages that were successfully forwarded
	FailedPrefix    string `json:"failedPrefix"`    // Prefix (directory) for messages that failed to be forwarded
}

AWS S3 configuration for storing incoming messages according to their states

type S3OutgoingConfig

type S3OutgoingConfig struct {
	SentPrefix   string `json:"sentPrefix"`   // Prefix (directory) for messages that were successfully sent
	FailedPrefix string `json:"failedPrefix"` // Prefix (directory) for messages that failed to be sent
}

AWS S3 configuration for storing outgoing messages according to their states

Jump to

Keyboard shortcuts

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