maildir

package
v0.0.0-...-0798a42 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 28 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 uint32)

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 []uint32,
) error

func (*Container) DeleteAll

func (c *Container) DeleteAll(d maildir.Dir, uids []uint32) ([]uint32, 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 uint32) bool

IsRecent returns if a uid has the Recent flag set

func (*Container) Message

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

Message returns a Message struct for the given UID and maildir

func (*Container) MessageFromKey

func (c *Container) MessageFromKey(d maildir.Dir, key string) *Message

func (*Container) MoveAll

func (c *Container) MoveAll(dest maildir.Dir, src maildir.Dir, uids []uint32) ([]uint32, 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) ([]uint32, 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) 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() uint32

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