emlfile

package
v0.0.0-...-d5b31fc Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2020 License: MIT Imports: 11 Imported by: 0

README

Emlfile

an EML file format parser

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnDefinedName = "undefined"
	UnDefinedAddr = "undefined@undefined.net"
)

Functions

func DecodeRFC2047

func DecodeRFC2047(text string) string

DecodeRFC2047 decode text according by RFC2047 if met plain text here, will return the orignal text =?utf-8?q?=E5=BC=A0=E5=B9=BF=E6=94=BF?= =?utf-8?b?5byg5bm/5pS/?=

func EncodeRFC2047

func EncodeRFC2047(s string) string

EncodeRFC2047 use mail's rfc2047 to encode any string See: https://godoc.org/mime#pkg-constants if met encoded text, will return the orignal text unchanged.

Types

type EMLBodyPart

type EMLBodyPart struct {
	Header textproto.MIMEHeader
	Body   []byte
}

type EMLData

type EMLData struct {
	Size int // mail raw size

	Header      stdmail.Header     // mail headers
	From        *stdmail.Address   // obtained from Header, always be set
	Tos         []*stdmail.Address // obtained from Header
	Ccs         []*stdmail.Address // obtained from Header
	Subject     string             // obtained from Header
	Date        time.Time          // obtained from Header
	ContentType string             // obtained from Header
	Encoding    string             // obtained from Header

	RawBody []byte         // mail raw contents
	Parts   []*EMLBodyPart // parsed from RawBytes if Content-Type is multiparts/
}

func ParseEml

func ParseEml(emlRaw []byte) (*EMLData, error)

ParseEml parse the raw eml bytes into EMLData

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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