mail

package module
v0.0.0-...-a6e25cb Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2012 License: MIT Imports: 12 Imported by: 1

README

This aims to be a more complete implementation of go's net/mail package.

Documentation

Overview

Package mail implements a parser for electronic mail messages as specified in RFC5322.

We allow both CRLF and LF to be used in the input, possibly mixed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseDate

func ParseDate(s string) time.Time

Types

type Address

type Address interface {
	String() string
	Name() string
}

func ParseAddress

func ParseAddress(bs []byte) (Address, error)

type GroupAddr

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

func (GroupAddr) Name

func (ga GroupAddr) Name() string

func (GroupAddr) String

func (ga GroupAddr) String() string
type Header struct {
	Key, Value string
}

type HeaderInfo

type HeaderInfo struct {
	FullHeaders []Header // all headers
	OptHeaders  []Header // unprocessed headers

	MessageId   string
	Id          string
	Date        time.Time
	From        []Address
	Sender      Address
	ReplyTo     []Address
	To          []Address
	Cc          []Address
	Bcc         []Address
	Subject     string
	Comments    []string
	Keywords    []string
	ContentType string

	InReply    []string
	References []string
}

type MailboxAddr

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

func (MailboxAddr) Name

func (ma MailboxAddr) Name() string

func (MailboxAddr) String

func (ma MailboxAddr) String() string

type Message

type Message struct {
	HeaderInfo

	Text  string
	Body  []byte
	Parts []Part
}

func Parse

func Parse(s []byte) (m Message, e error)

func Process

func Process(r RawMessage) (m Message, e error)

type Part

type Part struct {
	Type    string
	Data    []byte
	Headers map[string][]string
}

type RawHeader

type RawHeader struct {
	Key, Value []byte
}

type RawMessage

type RawMessage struct {
	RawHeaders []RawHeader
	Body       []byte
}

func ParseRaw

func ParseRaw(s []byte) (m RawMessage, e error)

Jump to

Keyboard shortcuts

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