email

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const SMIMEVerify jmap.URI = "urn:ietf:params:jmap:smimeverify"

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressGroup

type AddressGroup struct {
	Name string `json:"name,omitempty"`

	Addresses []*mail.Address `json:"addresses,omitempty"`
}

type BodyPart

type BodyPart struct {
	PartID string `json:"partId,omitempty"`

	BlobID jmap.ID `json:"blobId,omitempty"`

	Size uint64 `json:"size,omitempty"`

	Headers []*Header `json:"headers,omitempty"`

	Name string `json:"name,omitempty"`

	Type string `json:"type,omitempty"`

	Charset string `json:"charset,omitempty"`

	Disposition string `json:"disposition,omitempty"`

	CID string `json:"cid,omitempty"`

	Language []string `json:"language,omitempty"`

	Location string `json:"location,omitempty"`

	SubParts []*BodyPart `json:"subParts,omitempty"`
}

type BodyValue

type BodyValue struct {
	Value string `json:"value,omitempty"`

	IsEncodingProblem bool `json:"isEncodingProblem,omitempty"`

	IsTruncated bool `json:"isTruncated"`
}

type Changes

type Changes struct {
	Account jmap.ID `json:"accountId,omitempty"`

	SinceState string `json:"sinceState,omitempty"`

	MaxChanges uint64 `json:"maxChanges,omitempty"`
}

Get changes to emails on the whole account since a given state https://www.rfc-editor.org/rfc/rfc8621.html#section-4.3

func (*Changes) Name

func (m *Changes) Name() string

func (*Changes) Requires

func (m *Changes) Requires() []jmap.URI

type ChangesResponse

type ChangesResponse struct {
	Account jmap.ID `json:"accountId,omitempty"`

	OldState string `json:"oldState,omitempty"`

	NewState string `json:"newState,omitempty"`

	HasMoreChanges bool `json:"hasMoreChanges,omitempty"`

	Created []jmap.ID `json:"created,omitempty"`

	Updated []jmap.ID `json:"updated,omitempty"`

	Destroyed []jmap.ID `json:"destroyed,omitempty"`
}

type Copy

type Copy struct {
	FromAccount jmap.ID `json:"fromAccountId,omitempty"`

	IfFromInState string `json:"ifFromInState,omitempty"`

	Account jmap.ID `json:"accountId,omitempty"`

	IfInState string `json:"ifInState,omitempty"`

	Create map[jmap.ID]*Email `json:"create,omitempty"`

	OnSuccessDestroyOriginal bool `json:"onSuccessDestroyOriginal,omitempty"`

	DestroyFromIfInState string `json:"destroyFromIfInState,omitempty"`
}

Copy messages from one account to another https://www.rfc-editor.org/rfc/rfc8621.html#section-4.7

func (*Copy) Name

func (m *Copy) Name() string

func (*Copy) Requires

func (m *Copy) Requires() []jmap.URI

type CopyResponse

type CopyResponse struct {
	FromAccount jmap.ID `json:"fromAccountId,omitempty"`

	Account jmap.ID `json:"accountId,omitempty"`

	OldState string `json:"oldState,omitempty"`

	NewState string `json:"newState,omitempty"`

	Created map[jmap.ID]*Email `json:"created,omitempty"`

	NotCreated map[jmap.ID]*jmap.SetError `json:"notCreated,omitempty"`
}

type Email

type Email struct {
	ID jmap.ID `json:"id,omitempty"`

	BlobID jmap.ID `json:"blobId,omitempty"`

	ThreadID jmap.ID `json:"threadId,omitempty"`

	MailboxIDs map[jmap.ID]bool `json:"mailboxIds,omitempty"`

	Keywords map[string]bool `json:"keywords,omitempty"`

	Size uint64 `json:"size,omitempty"`

	ReceivedAt *time.Time `json:"receivedAt,omitempty"`

	Headers []*Header `json:"headers,omitempty"`

	MessageID []string `json:"messageId,omitempty"`

	InReplyTo []string `json:"inReplyTo,omitempty"`

	References []string `json:"references,omitempty"`

	Sender []*mail.Address `json:"sender,omitempty"`

	From []*mail.Address `json:"from,omitempty"`

	To []*mail.Address `json:"to,omitempty"`

	CC []*mail.Address `json:"cc,omitempty"`

	BCC []*mail.Address `json:"bcc,omitempty"`

	ReplyTo []*mail.Address `json:"replyTo,omitempty"`

	Subject string `json:"subject,omitempty"`

	SentAt *time.Time `json:"sentAt,omitempty"`

	BodyStructure *BodyPart `json:"bodyStructure,omitempty"`

	BodyValues map[string]*BodyValue `json:"bodyValues,omitempty"`

	TextBody []*BodyPart `json:"textBody,omitempty"`

	HTMLBody []*BodyPart `json:"htmlBody,omitempty"`

	Attachments []*BodyPart `json:"attachments,omitempty"`

	HasAttachment bool `json:"hasAttachment,omitempty"`

	Preview string `json:"preview,omitempty"`

	SMIMEStatus string `json:"smimeStatus,omitempty"`

	SMIMEStatusAtDelivery string `json:"smimeStatusAtDelivery,omitempty"`

	SMIMEErrors []string `json:"smimeErrors,omitempty"`

	SMIMEVerifiedAt *time.Time `json:"smimeVerifiedAt,omitempty"`
}

Representation of an RFC5322 message https://www.rfc-editor.org/rfc/rfc8621.html#section-4

type EmailImport

type EmailImport struct {
	BlobID jmap.ID `json:"blobId,omitempty"`

	MailboxIDs map[jmap.ID]bool `json:"mailboxIds,omitempty"`

	Keywords map[string]bool `json:"keywords,omitempty"`

	ReceivedAt *time.Time `json:"receivedAt,omitempty"`
}

type Filter

type Filter interface {
	// contains filtered or unexported methods
}

type FilterCondition

type FilterCondition struct {
	InMailbox jmap.ID `json:"inMailbox,omitempty"`

	InMailboxOtherThan []jmap.ID `json:"inMailboxOtherThan,omitempty"`

	Before *time.Time `json:"before,omitempty"`

	After *time.Time `json:"after,omitempty"`

	MinSize uint64 `json:"minSize,omitempty"`

	MaxSize uint64 `json:"maxSize,omitempty"`

	AllInThreadHaveKeyword string `json:"allInThreadHaveKeyword,omitempty"`

	SomeInThreadHaveKeyword string `json:"someInThreadHaveKeyword,omitempty"`

	NoneInThreadHaveKeyword string `json:"noneInThreadHaveKeyword,omitempty"`

	HasKeyword string `json:"hasKeyword,omitempty"`

	NotKeyword string `json:"notKeyword,omitempty"`

	HasAttachment bool `json:"hasAttachment,omitempty"`

	Text string `json:"text,omitempty"`

	From string `json:"from,omitempty"`

	To string `json:"to,omitempty"`

	Cc string `json:"cc,omitempty"`

	Bcc string `json:"bcc,omitempty"`

	Subject string `json:"subject,omitempty"`

	Body string `json:"body,omitempty"`

	Header []string `json:"header,omitempty"`

	HasSMIME bool `json:"hasSmime,omitempty"`

	HasVerifiedSMIME bool `json:"hasVerifiedSmime,omitempty"`

	HasVerifiedSMIMEAtDelivery bool `json:"hasVerifiedSmimeAtDelivery,omitempty"`
}

Email query condition that can be compounded with FilterOperator https://www.rfc-editor.org/rfc/rfc8621.html#section-4.4.1

func (*FilterCondition) MarshalJSON added in v0.4.2

func (fc *FilterCondition) MarshalJSON() ([]byte, error)

type FilterOperator

type FilterOperator struct {
	Operator jmap.Operator `json:"operator,omitempty"`

	Conditions []Filter `json:"conditions,omitempty"`
}

type Get

type Get struct {
	Account jmap.ID `json:"accountId,omitempty"`

	IDs []jmap.ID `json:"ids,omitempty"`

	Properties []string `json:"properties,omitempty"`

	BodyProperties []string `json:"bodyProperties,omitempty"`

	FetchTextBodyValues bool `json:"fetchTextBodyValues,omitempty"`

	FetchHTMLBodyValues bool `json:"fetchHTMLBodyValues,omitempty"`

	FetchAllBodyValues bool `json:"fetchAllBodyValues,omitempty"`

	MaxBodyValueBytes uint64 `json:"maxBodyValueBytes,omitempty"`

	ReferenceIDs *jmap.ResultReference `json:"#ids,omitempty"`

	ReferenceProperties *jmap.ResultReference `json:"#properties,omitempty"`
}

Get email details https://www.rfc-editor.org/rfc/rfc8621.html#section-4.2

func (*Get) Name

func (m *Get) Name() string

func (*Get) Requires

func (m *Get) Requires() []jmap.URI

type GetResponse

type GetResponse struct {
	Account jmap.ID `json:"accountId,omitempty"`

	State string `json:"state,omitempty"`

	List []*Email `json:"list,omitempty"`

	NotFound []jmap.ID `json:"notFound,omitempty"`
}
type Header struct {
	Name string `json:"name,omitempty"`

	Value string `json:"value,omitempty"`
}

type Import

type Import struct {
	Account jmap.ID `json:"accountId,omitempty"`

	IfInState string `json:"ifInState,omitempty"`

	Emails map[string]*EmailImport `json:"emails,omitempty"`
}

Import email from binary blobs https://www.rfc-editor.org/rfc/rfc8621.html#section-4.8

func (*Import) Name

func (m *Import) Name() string

func (*Import) Requires

func (m *Import) Requires() []jmap.URI

type ImportResponse

type ImportResponse struct {
	Account jmap.ID `json:"accountId,omitempty"`

	OldState string `json:"oldState,omitempty"`

	NewState string `json:"newState,omitempty"`

	Created map[jmap.ID]*Email `json:"created,omitempty"`

	NotCreated map[jmap.ID]*jmap.SetError `json:"notCreated,omitempty"`
}

type Parse

type Parse struct {
	Account jmap.ID `json:"accountId,omitempty"`

	BlobIDs []jmap.ID `json:"blobIds,omitempty"`

	Properties []string `json:"properties,omitempty"`

	BodyProperties []string `json:"bodyProperties,omitempty"`

	FetchTextBodyValues bool `json:"fetchTextBodyValues,omitempty"`

	FetchHTMLBodyValues bool `json:"fetchHTMLBodyValues,omitempty"`

	FetchAllBodyValues bool `json:"fetchAllBodyValues,omitempty"`

	MaxBodyValueBytes uint64 `json:"maxBodyValueBytes,omitempty"`
}

Parse binary blobs as RFC5322 messages https://www.rfc-editor.org/rfc/rfc8621.html#section-4.9

func (*Parse) Name

func (m *Parse) Name() string

func (*Parse) Requires

func (m *Parse) Requires() []jmap.URI

type ParseResponse

type ParseResponse struct {
	Account jmap.ID `json:"accountId,omitempty"`

	Parsed map[jmap.ID]*Email `json:"parsed,omitempty"`

	NotParsable []jmap.ID `json:"notParsable,omitempty"`

	NotFound []jmap.ID `json:"notFound,omitempty"`
}

type Query

type Query struct {
	Account jmap.ID `json:"accountId,omitempty"`

	Filter Filter `json:"filter,omitempty"`

	Sort []*SortComparator `json:"sort,omitempty"`

	Position int64 `json:"position,omitempty"`

	Anchor jmap.ID `json:"anchor,omitempty"`

	AnchorOffset int64 `json:"anchorOffset,omitempty"`

	Limit uint64 `json:"limit,omitempty"`

	CalculateTotal bool `json:"calculateTotal,omitempty"`

	CollapseThreads bool `json:"collapseThreads,omitempty"`
}

Get list of email IDs based on filter and sort criteria https://www.rfc-editor.org/rfc/rfc8621.html#section-4.4

func (*Query) Name

func (m *Query) Name() string

func (*Query) Requires

func (m *Query) Requires() []jmap.URI

type QueryChanges

type QueryChanges struct {
	Account jmap.ID `json:"accountId,omitempty"`

	Filter Filter `json:"filter,omitempty"`

	Sort []*SortComparator `json:"sort,omitempty"`

	SinceQueryState string `json:"sinceQueryState,omitempty"`

	MaxChanges uint64 `json:"maxChanges,omitempty"`

	UpToID jmap.ID `json:"upToId,omitempty"`

	CalculateTotal bool `json:"calculateTotal,omitempty"`

	CollapseThreads bool `json:"collapseThreads,omitempty"`
}

Get changes to an email query since a given state https://www.rfc-editor.org/rfc/rfc8621.html#section-4.5

func (*QueryChanges) Name

func (m *QueryChanges) Name() string

func (*QueryChanges) Requires

func (m *QueryChanges) Requires() []jmap.URI

type QueryChangesResponse

type QueryChangesResponse struct {
	Account jmap.ID `json:"accountId,omitempty"`

	OldQueryState string `json:"oldQueryState,omitempty"`

	NewQueryState string `json:"newQueryState,omitempty"`

	Removed []jmap.ID `json:"removed,omitempty"`

	Added []jmap.AddedItem `json:"added,omitempty"`
}

type QueryResponse

type QueryResponse struct {
	Account jmap.ID `json:"accountId,omitempty"`

	QueryState string `json:"queryState,omitempty"`

	CanCalculateChanges bool `json:"canCalculateChanges,omitempty"`

	Position uint64 `json:"position,omitempty"`

	IDs []jmap.ID `json:"ids,omitempty"`

	Total uint64 `json:"total,omitempty"`

	Limit uint64 `json:"limit,omitempty"`
}

type Set

type Set struct {
	Account jmap.ID `json:"accountId,omitempty"`

	IfInState string `json:"ifInState,omitempty"`

	Create map[jmap.ID]*Email `json:"create,omitempty"`

	Update map[jmap.ID]jmap.Patch `json:"update,omitempty"`

	Destroy []jmap.ID `json:"destroy,omitempty"`
}

Create, delete or update emails https://www.rfc-editor.org/rfc/rfc8621.html#section-4.6

func (*Set) Name

func (m *Set) Name() string

func (*Set) Requires

func (m *Set) Requires() []jmap.URI

type SetResponse

type SetResponse struct {
	Account jmap.ID `json:"accountId,omitempty"`

	OldState string `json:"oldState,omitempty"`

	NewState string `json:"newState,omitempty"`

	Created map[jmap.ID]*Email `json:"created,omitempty"`

	Updated map[jmap.ID]*Email `json:"updated,omitempty"`

	Destroyed []jmap.ID `json:"destroyed,omitempty"`

	NotCreated map[jmap.ID]*jmap.SetError `json:"notCreated,omitempty"`

	NotUpdated map[jmap.ID]*jmap.SetError `json:"notUpdated,omitempty"`

	NotDestroyed map[jmap.ID]*jmap.SetError `json:"notDestroyed,omitempty"`
}

type SortComparator

type SortComparator struct {
	Property string `json:"property,omitempty"`

	Keyword string `json:"keyword,omitempty"`

	IsAscending bool `json:"isAscending,omitempty"`

	Collation jmap.CollationAlgo `json:"collation,omitempty"`
}

Email sort criteria https://www.rfc-editor.org/rfc/rfc8621.html#section-4.4.2

Jump to

Keyboard shortcuts

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