hook

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataHook

type DataHook func(context.Context, bool, io.Reader) (*Result, error)

DataHook is a hook called during `DATA`.

func DataHooks

func DataHooks() []DataHook

DataHooks creates all available and enabled DataHook implementations.

type FromHook

type FromHook func(context.Context, bool, net.IP, models.Address) (*Result, error)

FromHook is a hook called during `MAIL`.

func FromHooks

func FromHooks() []FromHook

FromHooks creates all available and enabled FromHook implementations.

type HeaderField

type HeaderField struct {
	Key   string
	Value string
}

HeaderField is a single mail header, that is to be set as a result of a hook.

type Result

type Result struct {
	// Reject indicates if the mail should not be accepted for delivery.
	Reject bool
	// Headers is a list of headers to be prepended to incoming mail, if it is not rejected.
	Headers []HeaderField
	// Code is the smtp reply code used on rejection.
	Code int
	// Text is the smtp reply text used on rejection.
	Text string
}

Result is the result of calling a hook on incoming mail.

Jump to

Keyboard shortcuts

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