mailbox

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Changes

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

	SinceState string `json:"sinceState,omitempty"`

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

Get mailbox changes for the whole account https://www.rfc-editor.org/rfc/rfc8621.html#section-2.2

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"`

	UpdatedProperties []string `json:"updatedProperties,omitempty"`
}

type Filter

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

type FilterCondition

type FilterCondition struct {
	ParentID jmap.ID `json:"parentId,omitempty"`

	Name string `json:"name,omitempty"`

	Role Role `json:"role,omitempty"`

	HasAnyRole bool `json:"hasAnyRole,omitempty"`

	IsSubscribed bool `json:"isSubscribed,omitempty"`
}

Filter criteria for mailbox queries https://www.rfc-editor.org/rfc/rfc8621.html#section-2.3

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"`

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

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

Get mailbox details https://www.rfc-editor.org/rfc/rfc8621.html#section-2.1

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 []*Mailbox `json:"list,omitempty"`

	NotFound []string `json:"notFound,omitempty"`
}

type Mailbox

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

	Name string `json:"name,omitempty"`

	ParentID jmap.ID `json:"parentId,omitempty"`

	Role Role `json:"role,omitempty"`

	SortOrder uint64 `json:"sortOrder,omitempty"`

	TotalEmails uint64 `json:"totalEmails,omitempty"`

	UnreadEmails uint64 `json:"unreadEmails,omitempty"`

	TotalThreads uint64 `json:"totalThreads,omitempty"`

	UnreadThreads uint64 `json:"unreadThreads,omitempty"`

	Rights *Rights `json:"myRights,omitempty"`

	IsSubscribed bool `json:"isSubscribed,omitempty"`
}

Named set of Email objects. Can be viewed as a folder or a label. An email must be part of at least one Mailbox. https://www.rfc-editor.org/rfc/rfc8621.html#section-2

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"`

	SortAsTree bool `json:"sortAsTree,omitempty"`

	FilterAsTree bool `json:"filterAsTree,omitempty"`
}

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

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"`
}

Get changes on a mailbox query https://www.rfc-editor.org/rfc/rfc8621.html#section-2.4

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 int64 `json:"total,omitempty"`

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

type Rights

type Rights struct {
	MayReadItems bool `json:"mayReadItems,omitempty"`

	MayAddItems bool `json:"mayAddItems,omitempty"`

	MayRemoveItems bool `json:"mayRemoveItems,omitempty"`

	MaySetSeen bool `json:"maySetSeen,omitempty"`

	MaySetKeywords bool `json:"maySetKeywords,omitempty"`

	MayCreateChild bool `json:"mayCreateChild,omitempty"`

	MayRename bool `json:"mayRename,omitempty"`

	MayDelete bool `json:"mayDelete,omitempty"`

	MaySubmit bool `json:"maySubmit,omitempty"`
}

Access Control Lists (ACLs)

type Role

type Role string

Identifies Mailboxes that have a particular common purpose (e.g., the “inbox”), regardless of the name property (which may be localised).

const (
	RoleAll Role = "all"

	RoleArchive Role = "archive"

	RoleDrafts Role = "drafts"

	RoleFlagged Role = "flagged"

	RoleHasChildren Role = "haschildren"

	RoleHasNoChildren Role = "hasnochildren"

	RoleImportant Role = "important"

	RoleInbox Role = "inbox"

	RoleJunk Role = "junk"

	RoleMarked Role = "marked"

	RoleNoInferiors Role = "noinferiors"

	RoleNonExistent Role = "nonexistent"

	RoleNoSelect Role = "noselect"

	RoleRemote Role = "remote"

	RoleSent Role = "sent"

	RoleSubscribed Role = "subscribed"

	RoleTrash Role = "trash"

	RoleUnmarked Role = "unmarked"
)

type Set

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

	IfInState string `json:"ifInState,omitempty"`

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

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

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

	OnDestroyRemoveEmails bool `json:"onDestroyRemoveEmails,omitempty"`
}

Create, delete & modify mailboxes https://www.rfc-editor.org/rfc/rfc8621.html#section-2.5

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]*Mailbox `json:"created,omitempty"`

	Updated map[jmap.ID]*Mailbox `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 {
	// The name of the property on the Mailbox objects to compare.
	Property string `json:"property,omitempty"`

	// If true, sort in ascending order.
	IsAscending bool `json:"isAscending"`

	// The identifier, as registered in the collation registry defined in
	// RFC4790, for the algorithm to use when comparing the order of
	// strings.
	Collation jmap.CollationAlgo `json:"collation,omitempty"`
}

Jump to

Keyboard shortcuts

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