parsemail

package
v0.1.18 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Vendored code from https://github.com/ArkaGPL/parsemail This code addresses some fixes missing from github.com/DusanKasan/parsemail. See https://github.com/DusanKasan/parsemail/pull/26. Once this PR is merged, we can use the upstream module again. nolint // This package is soft-vendored from https://github.com/ArkaGPL/parsemail

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	Filename    string
	ContentType string
	Data        io.Reader
}

Attachment with filename, content type and data (as a io.Reader)

type Email

type Email struct {
	Header mail.Header

	Subject    string
	Sender     *mail.Address
	From       []*mail.Address
	ReplyTo    []*mail.Address
	To         []*mail.Address
	Cc         []*mail.Address
	Bcc        []*mail.Address
	Date       time.Time
	MessageID  string
	InReplyTo  []string
	References []string

	ResentFrom      []*mail.Address
	ResentSender    *mail.Address
	ResentTo        []*mail.Address
	ResentDate      time.Time
	ResentCc        []*mail.Address
	ResentBcc       []*mail.Address
	ResentMessageID string

	ContentType string
	Content     io.Reader

	HTMLBody string
	TextBody string

	Attachments   []Attachment
	EmbeddedFiles []EmbeddedFile
}

Email with fields for all the headers defined in RFC5322 with it's attachments and

func Parse

func Parse(r io.Reader) (email Email, err error)

Parse an email message read from io.Reader into parsemail.Email struct

type EmbeddedFile

type EmbeddedFile struct {
	CID         string
	ContentType string
	Data        io.Reader
}

EmbeddedFile with content id, content type and data (as a io.Reader)

Jump to

Keyboard shortcuts

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