maildir

package
v0.0.0-...-1a3b2b2 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMaildirppWorker

func NewMaildirppWorker(worker *types.Worker) (types.Backend, error)

NewMaildirppWorker creates a new Maildir++ worker with the provided worker.

func NewWorker

func NewWorker(worker *types.Worker) (types.Backend, error)

NewWorker creates a new maildir worker with the provided worker.

Types

type Container

type Container struct {
	Store *lib.MaildirStore
	// contains filtered or unexported fields
}

A Container is a directory which contains other directories which adhere to the Maildir spec

func NewContainer

func NewContainer(dir string, maildirpp bool) (*Container, error)

NewContainer creates a new container at the specified directory

func (*Container) ClearRecentFlag

func (c *Container) ClearRecentFlag(uid models.UID)

ClearRecentFlag removes the Recent flag from the message with the given uid

func (*Container) CopyAll

func (c *Container) CopyAll(
	dest maildir.Dir, src maildir.Dir, uids []models.UID,
) error

func (*Container) DeleteAll

func (c *Container) DeleteAll(d maildir.Dir, uids []models.UID) ([]models.UID, error)

DeleteAll deletes a set of messages by UID and returns the subset of UIDs which were successfully deleted, stopping upon the first error.

func (*Container) IsRecent

func (c *Container) IsRecent(uid models.UID) bool

IsRecent returns if a uid has the Recent flag set

func (*Container) Message

func (c *Container) Message(d maildir.Dir, uid models.UID) (*Message, error)

Message returns a Message struct for the given UID and maildir

func (*Container) MoveAll

func (c *Container) MoveAll(dest maildir.Dir, src maildir.Dir, uids []models.UID) ([]models.UID, error)

func (*Container) OpenDirectory

func (c *Container) OpenDirectory(name string) (maildir.Dir, error)

OpenDirectory opens an existing maildir in the container by name, moves new messages into cur, and registers the new keys in the UIDStore.

func (*Container) SyncNewMail

func (c *Container) SyncNewMail(dir maildir.Dir) error

SyncNewMail adds emails from new to cur, tracking them

func (*Container) UIDs

func (c *Container) UIDs(d maildir.Dir) ([]models.UID, error)

UIDs fetches the unique message identifiers for the maildir

type Message

type Message struct {
	// contains filtered or unexported fields
}

A Message is an individual email inside of a maildir.Dir.

func (Message) Flags

func (m Message) Flags() ([]maildir.Flag, error)

Flags fetches the set of flags currently applied to the message.

func (Message) Labels

func (m Message) Labels() ([]string, error)

func (Message) MarkForwarded

func (m Message) MarkForwarded(forwarded bool) error

MarkForwarded either adds or removes the maildir.FlagForwarded flag from the message.

func (Message) MarkReplied

func (m Message) MarkReplied(answered bool) error

MarkReplied either adds or removes the maildir.FlagReplied flag from the message.

func (Message) MessageHeaders

func (m Message) MessageHeaders() (*models.MessageInfo, error)

MessageHeaders populates a models.MessageInfo struct for the message with minimal information, used for sorting and threading.

func (Message) MessageInfo

func (m Message) MessageInfo() (*models.MessageInfo, error)

MessageInfo populates a models.MessageInfo struct for the message.

func (Message) ModelFlags

func (m Message) ModelFlags() (models.Flags, error)

ModelFlags fetches the set of models.flags currently applied to the message.

func (Message) NewBodyPartReader

func (m Message) NewBodyPartReader(requestedParts []int) (io.Reader, error)

NewBodyPartReader creates a new io.Reader for the requested body part(s) of the message.

func (Message) NewReader

func (m Message) NewReader() (io.ReadCloser, error)

NewReader reads a message into memory and returns an io.Reader for it.

func (Message) Remove

func (m Message) Remove() error

Remove deletes the email immediately.

func (Message) SetFlags

func (m Message) SetFlags(flags []maildir.Flag) error

SetFlags replaces the message's flags with a new set.

func (Message) SetOneFlag

func (m Message) SetOneFlag(flag maildir.Flag, enable bool) error

SetOneFlag enables or disables a single message flag on the message.

func (Message) Size

func (m Message) Size() (uint32, error)

func (Message) UID

func (m Message) UID() models.UID

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

A Worker handles interfacing between aerc's UI and a group of maildirs.

func (*Worker) Capabilities

func (w *Worker) Capabilities() *models.Capabilities

func (*Worker) PathSeparator

func (w *Worker) PathSeparator() string

func (*Worker) Run

func (w *Worker) Run()

Run starts the worker's message handling loop.

Jump to

Keyboard shortcuts

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