mail

package standard library
go1.8.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2017 License: BSD-3-Clause Imports: 11 Imported by: 25,782

Documentation

Overview

Package mail implements parsing of mail messages.

For the most part, this package follows the syntax as specified by RFC 5322 and extended by RFC 6532. Notable divergences:

  • Obsolete address formats are not parsed, including addresses with embedded route information.
  • Group addresses are not parsed.
  • The full range of spacing (the CFWS syntax element) is not supported, such as breaking addresses across lines.
  • No unicode normalization is performed.

Index

Examples

Constants

This section is empty.

Variables

View Source
var ErrHeaderNotPresent = errors.New("mail: header not in message")

Functions

func ParseDate added in go1.8

func ParseDate(date string) (time.Time, error)

ParseDate parses an RFC 5322 date string.

Types

type Address

type Address struct {
	Name    string // Proper name; may be empty.
	Address string // user@domain
}

Address represents a single mail address. An address such as "Barry Gibbs <bg@example.com>" is represented as Address{Name: "Barry Gibbs", Address: "bg@example.com"}.

func