mail

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: BSD-3-Clause Imports: 43 Imported by: 0

Documentation

Overview

Package mail implements a GUI email client.

Index

Constants

This section is empty.

Variables

View Source
var Settings = &SettingsData{
	SettingsBase: core.SettingsBase{
		Name: "Mail",
		File: filepath.Join(core.TheApp.DataDir(), "Cogent Mail", "settings.toml"),
	},
}

Settings is the currently active global Cogent Mail settings instance.

Functions

func IMAPToMailAddresses

func IMAPToMailAddresses(as []imap.Address) []*mail.Address

IMAPToMailAddresses converts the given [imap.Address]es to [mail.Address]es.

Types

type AddressTextField

type AddressTextField struct {
	core.TextField
	Address mail.Address
}

AddressTextField represents a mail.Address with a core.TextField.

func NewAddressTextField

func NewAddressTextField(parent ...tree.Node) *AddressTextField

NewAddressTextField returns a new AddressTextField with the given optional parent: AddressTextField represents a mail.Address with a core.TextField.

func (*AddressTextField) Init added in v0.1.0

func (at *AddressTextField) Init()

func (*AddressTextField) SetAddress added in v0.1.1

func (t *AddressTextField) SetAddress(v mail.Address) *AddressTextField

SetAddress sets the [AddressTextField.Address]

func (*AddressTextField) WidgetValue added in v0.1.0

func (at *AddressTextField) WidgetValue() any

type App

type App struct {
	core.Frame
	// contains filtered or unexported fields
}

App is an email client app.

func NewApp

func NewApp(parent ...tree.Node) *App

NewApp returns a new App with the given optional parent: App is an email client app.

func (*App) Compose

func (a *App) Compose()

Compose opens a dialog to send a new message.

func (*App) Delete added in v0.1.1

func (a *App) Delete()

Delete moves the current message to the trash.

func (*App) Forward added in v0.1.1

func (a *App) Forward()

Forward opens a dialog to forward the current message to others.

func (*App) GetMail

func (a *App) GetMail()

func (*App) Init

func (a *App) Init()

func (*App) Label added in v0.1.1

func (a *App) Label()

Label opens a dialog for changing the labels (mailboxes) of the current message.

func (*App) MakeToolbar

func (a *App) MakeToolbar(p *tree.Plan)

func (*App) MarkAsRead added in v0.1.1

func (a *App) MarkAsRead()

MarkAsRead marks the current message as read.

func (*App) MarkAsUnread added in v0.1.1

func (a *App) MarkAsUnread()

MarkAsUnread marks the current message as unread.

func (*App) Reply added in v0.1.1

func (a *App) Reply()

Reply opens a dialog to reply to the current message.

func (*App) ReplyAll added in v0.1.1

func (a *App) ReplyAll()

ReplyAll opens a dialog to reply to all people involved in the current message.

func (*App) Send added in v0.1.1

func (a *App) Send() error

Send sends the current message

type Attachment added in v0.1.1

type Attachment struct {
	Filename string
	Data     []byte
}

Attachment represents an email attachment when reading a message.

type AttachmentButton added in v0.1.1

type AttachmentButton struct {
	core.Button
	Attachment *Attachment
}

AttachmentButton represents an Attachment with a core.Button.

func NewAttachmentButton added in v0.1.1

func NewAttachmentButton(parent ...tree.Node) *AttachmentButton

NewAttachmentButton returns a new AttachmentButton with the given optional parent: AttachmentButton represents an Attachment with a core.Button.

func (*AttachmentButton) Init added in v0.1.1

func (ab *AttachmentButton) Init()

func (*AttachmentButton) SetAttachment added in v0.1.1

func (t *AttachmentButton) SetAttachment(v *Attachment) *AttachmentButton

SetAttachment sets the [AttachmentButton.Attachment]

func (*AttachmentButton) WidgetValue added in v0.1.1

func (ab *AttachmentButton) WidgetValue() any

type CacheMessage added in v0.1.1

type CacheMessage struct {
	imap.Envelope

	// Filename is the unique filename of the cached message contents.
	Filename string

	// Flags are the IMAP flags associated with the message.
	Flags []imap.Flag

	// Labels are the labels associated with the message.
	// Labels are many-to-many, similar to gmail. All labels
	// also correspond to IMAP mailboxes.
	Labels []Label
	// contains filtered or unexported fields
}

CacheMessage contains the data stored for a cached message in the cached messages file. It contains basic information about the message so that it can be displayed in the mail list in the GUI.

func (*CacheMessage) ToDisplay added in v0.1.1

func (cm *CacheMessage) ToDisplay() *displayMessage

ToDisplay converts the CacheMessage to a [displayMessage] with the given additional [readMessageParsed] data.

type DisplayMessageFrame added in v0.1.1

type DisplayMessageFrame struct {
	core.Frame
	Message *CacheMessage
}

DisplayMessageFrame is a frame that displays the metadata and contents of a message.

func NewDisplayMessageFrame added in v0.1.1

func NewDisplayMessageFrame(parent ...tree.Node) *DisplayMessageFrame

NewDisplayMessageFrame returns a new DisplayMessageFrame with the given optional parent: DisplayMessageFrame is a frame that displays the metadata and contents of a message.

func (*DisplayMessageFrame) Init added in v0.1.1

func (dmf *DisplayMessageFrame) Init()

func (*DisplayMessageFrame) SetMessage added in v0.1.1

SetMessage sets the [DisplayMessageFrame.Message]

func (*DisplayMessageFrame) WidgetValue added in v0.1.1

func (dmf *DisplayMessageFrame) WidgetValue() any

type Label added in v0.1.1

type Label struct {
	Name string
	UID  imap.UID
}

Label represents a Label associated with a message. It contains the name of the Label and the UID of the message in the IMAP mailbox corresponding to the Label.

func (*Label) UIDSet added in v0.1.1

func (lb *Label) UIDSet() imap.UIDSet

UIDSet returns an imap.UIDSet that contains just the UID of the message in the IMAP mailbox corresponding to the Label.

type MessageListItem added in v0.1.1

type MessageListItem struct {
	core.Frame
	Message *CacheMessage
}

MessageListItem represents a CacheMessage with a core.Frame for the message list.

func NewMessageListItem added in v0.1.1

func NewMessageListItem(parent ...tree.Node) *MessageListItem

NewMessageListItem returns a new MessageListItem with the given optional parent: MessageListItem represents a CacheMessage with a core.Frame for the message list.

func (*MessageListItem) Init added in v0.1.1

func (mi *MessageListItem) Init()

func (*MessageListItem) SetMessage added in v0.1.1

func (t *MessageListItem) SetMessage(v *CacheMessage) *MessageListItem

SetMessage sets the [MessageListItem.Message]

func (*MessageListItem) WidgetValue added in v0.1.1

func (mi *MessageListItem) WidgetValue() any

type SendMessage

type SendMessage struct {
	From        []*mail.Address `display:"inline"`
	To          []*mail.Address `display:"inline"`
	Subject     string
	Attachments []core.Filename `display:"inline"`
	// contains filtered or unexported fields
}

SendMessage represents the data necessary for the user to send a message.

type SettingsData

type SettingsData struct {
	core.SettingsBase

	// Accounts are the email accounts the user is signed into.
	Accounts []string
}

SettingsData is the data type for the global Cogent Mail settings.

Directories

Path Synopsis
cmd
mail command

Jump to

Keyboard shortcuts

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