rfc5322

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CharsetReader func(charset string, input io.Reader) (io.Reader, error)
View Source
var ErrInvalidMessage = errors.New("invalid rfc5322 message")

Functions

func ParseAddress

func ParseAddress(input string) ([]*mail.Address, error)

func ParseAddressList

func ParseAddressList(input string) ([]*mail.Address, error)

func ParseDateTime

func ParseDateTime(input string) (time.Time, error)

func ValidateMessageHeaderFields added in v0.17.0

func ValidateMessageHeaderFields(literal []byte) error

ValidateMessageHeaderFields checks the headers of message to verify that: * From and Date are present. * If From has multiple addresses, a Sender field must be present. * If Both From and Sender are present and they contain one address, they must not be equal.

Types

type BacktrackingByteScanner

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

func NewBacktrackingByteScanner

func NewBacktrackingByteScanner(data []byte) *BacktrackingByteScanner

func (*BacktrackingByteScanner) Read

func (bs *BacktrackingByteScanner) Read(dst []byte) (int, error)

func (*BacktrackingByteScanner) ReadByte

func (bs *BacktrackingByteScanner) ReadByte() (byte, error)

func (*BacktrackingByteScanner) ReadBytes

func (bs *BacktrackingByteScanner) ReadBytes(delim byte) ([]byte, error)

func (*BacktrackingByteScanner) RestoreState

func (bs *BacktrackingByteScanner) RestoreState(scope BacktrackingByteScannerScope)

func (*BacktrackingByteScanner) SaveState

type BacktrackingByteScannerScope

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

type Parser

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

func (*Parser) RestoreState

func (p *Parser) RestoreState(s ParserState)

func (*Parser) SaveState

func (p *Parser) SaveState() ParserState

type ParserState

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

Jump to

Keyboard shortcuts

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