config

package
v0.0.0-...-0aabb05 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2026 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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