email

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: AGPL-3.0 Imports: 11 Imported by: 1 module, 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 Attachment

type Attachment struct {
	ContentType string
	Content     []byte
	Filename    string
}

type Attendee

type Attendee struct {
	Email  string
	Status ics.ParticipationStatus
}

type EmbeddedFile

type EmbeddedFile struct {
	ContentType string
	ContentId   string
	Content     []byte
	Filename    string
}

type Envelope

type Envelope struct {
	Date      time.Time
	Subject   string
	MessageID string
	InReplyTo string
	From      []string
	Sender    []string
	ReplyTo   []string
	To        []string
	Cc        []string
	Bcc       []string
}

type Event

type Event struct {
	Id          string
	Attendees   []*Attendee
	Description string
	Summary     string
	Link        string
}

type Message

type Message struct {
	UID          uint32
	SeqNum       uint32
	Flags        []imap.Flag
	InternalDate time.Time
	RFC822Size   int64

	Mailbox string

	ContentType string

	Raw []byte

	Headers map[string][]string

	RawHeaders []byte
	RawBody    []byte
	RawMime    []byte

	Text string
	HTML string

	Attachments    []*Attachment
	HasAttachments bool

	Embedded  []*EmbeddedFile
	HasEmbeds bool

	Events     []*Event
	HasEvents  bool
	RawInvites [][]byte

	Envelope *Envelope
}

func NewMessage

func NewMessage() *Message

func NewMessageFromIMAP

func NewMessageFromIMAP(buffer *imapclient.FetchMessageBuffer, fields map[string]bool) (*Message, error)

func (*Message) AddFlags

func (m *Message) AddFlags(c *imapclient.Client, flags ...imap.Flag) error

AddFlags adds the specified flags to the message.

func (*Message) Copy

func (m *Message) Copy(c *imapclient.Client, mailbox string) error

Copy copies the specified message(s) to the end of the specified destination mailbox.

func (*Message) DeleteFlags

func (m *Message) DeleteFlags(c *imapclient.Client, flags ...imap.Flag) error

DeleteFlags removes the specified flags from the message.

func (*Message) Fetch

func (m *Message) Fetch(c *imapclient.Client, options ...*imap.FetchOptions) error

func (*Message) FromIMAP

func (m *Message) FromIMAP(buffer *imapclient.FetchMessageBuffer, fields map[string]bool) error

FromIMAP converts a raw IMAP message into a Message object.

func (*Message) FromIMAPEnvelope

func (m *Message) FromIMAPEnvelope(envelope *imap.Envelope, fields map[string]bool) error

func (*Message) HasFlag

func (m *Message) HasFlag(flag imap.Flag) bool

HasFlag checks if the message has the specified flag.

func (*Message) MarkDeleted

func (m *Message) MarkDeleted(c *imapclient.Client) error

MarkDeleted marks the message to be deleted.

func (*Message) MarkDraft

func (m *Message) MarkDraft(c *imapclient.Client) error

MarkDraft marks the message as a draft.

func (*Message) MarkFlagged

func (m *Message) MarkFlagged(c *imapclient.Client) error

MarkFlagged marks the message as flagged / important.

func (*Message) MarkSeen

func (m *Message) MarkSeen(c *imapclient.Client) error

MarkSeen marks the message as seen.

func (*Message) MarkUndeleted

func (m *Message) MarkUndeleted(c *imapclient.Client) error

MarkUndeleted removes the deleted flag from the message.

func (*Message) MarkUndraft

func (m *Message) MarkUndraft(c *imapclient.Client) error

MarkUndraft removes the draft flag from the message.

func (*Message) MarkUnflagged

func (m *Message) MarkUnflagged(c *imapclient.Client) error

MarkUnflagged removes the flagged / important flag from the message.

func (*Message) MarkUnseen

func (m *Message) MarkUnseen(c *imapclient.Client) error

MarkUnseen marks the message as unseen.

func (*Message) Move

func (m *Message) Move(c *imapclient.Client, mailbox string) error

Move copies the specified message(s) to the end of the specified destination mailbox.

func (*Message) SetFlags

func (m *Message) SetFlags(c *imapclient.Client, flags ...imap.Flag) error

SetFlags sets the specified flags for the message.

Jump to

Keyboard shortcuts

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