mime

package
v0.0.0-...-bf75c1d Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package mime reads the structure of a multipart mail message without reading the complete message into memory.

Index

Constants

View Source
const (
	// DepthLimit is the maximum supported depth of multipart MIME tree
	DepthLimit = 256
)

Variables

View Source
var (
	// ErrDepthLimitExceeded is reported if the MIME message exceeds DepthLimit
	ErrDepthLimitExceeded = errors.New("maximum depth of multipart MIME tree exceeded")
	// ErrTooManyParts is reported when a message contains too many MIME parts
	ErrTooManyParts = errors.New("multipart MIME has too many parts")
)

Functions

This section is empty.

Types

type ErrBadHeader

type ErrBadHeader string

ErrBadHeader is an error that indicates a problem with a MIME Header line.

func (ErrBadHeader) Error

func (e ErrBadHeader) Error() string

type Message

type Message struct {
	Part
	Subject   string
	MessageID string
	Date      time.Time
	Body      string
}

Message holds the structure of an email message.

func ReadMessage

func ReadMessage(r io.Reader) (*Message, error)

ReadMessage reads the structure of a multipart MIME message into a Message struct.

type Part

type Part struct {
	Header       textproto.MIMEHeader
	ContentStart int
	ContentEnd   int
	Parts        []Part
}

Part holds part of a multipart mime message.

Jump to

Keyboard shortcuts

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