mailbox

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeIMAPUTF7 added in v0.0.4

func DecodeIMAPUTF7(input string) (string, error)

Types

type Entry

type Entry struct {
	Name  string
	Files []string
}

Entry represents a single mailbox with its files

type Flag

type Flag string
const (
	Seen     Flag = "seen"
	Answered Flag = "answered"
	Flagged  Flag = "flagged"
	Deleted  Flag = "deleted"
	Draft    Flag = "draft"
)

type Format

type Format string

Format represents the format of the mailbox

const (
	Maildir       Format = "maildir"
	MaildirNested Format = "maildir-nested"
)

type Mailbox

type Mailbox struct {
	Path   string // mailbox path
	Folder string // mailbox folder name
	// contains filtered or unexported fields
}

Mailbox represents a mailbox iterator for a single mailbox

func NewMailbox

func NewMailbox(format Format, path string) ([]*Mailbox, error)

NewMailbox creates mailbox iterators for all mailboxes found

func (*Mailbox) ScanFiles added in v0.0.3

func (m *Mailbox) ScanFiles() (*ScanResult, error)

ScanFiles scans the mailbox directory for message files

type Message

type Message struct {
	Identifier   string
	MailboxName  string // Added mailbox name for nested maildir support
	Flags        []Flag
	Keywords     map[string]bool // converted JMAP keywords
	InternalDate int64
	Contents     []byte
}

Message represents an email message

func NewMaildirMessage added in v0.0.3

func NewMaildirMessage(box *Mailbox, filename string) (*Message, error)

type ScanResult added in v0.0.3

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

func (*ScanResult) Next added in v0.0.3

func (s *ScanResult) Next() (*Message, error)

Next returns the next message from the mailbox

Jump to

Keyboard shortcuts

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