mailet

package
v0.0.0-...-cc6473a Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TerminateProcessing = errors.New("Terminate Processing")

TerminateProcessing indicates that this mailet wants to terminate the procesing of the chain.

Functions

This section is empty.

Types

type Mail

type Mail struct {
	RemoteAddr net.Addr
	From       string
	To         []string
	Message    mail.Message
}

Mail represents incoming emails received by the SMTP server.

type Mailet

type Mailet interface {
	Handle(*Mail) error
}

Mailet is a handler for incoming SMTP mails.

type MailetFunc

type MailetFunc func(m *Mail)

type Processor

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

Processor applies a mail to each of the set of configured Mailets.

func NewProcessor

func NewProcessor(m []Mailet) *Processor

NewProcessor creates and returns a new Processor.

func (Processor) Handle

func (p Processor) Handle(m *Mail) error

Handle iterates through all the configured Mailets and asks them to handle an incoming Mail.

A Mailet can indicate that the processing should terminate by returning the TerminateProcessing error.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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