Documentation
¶
Overview ¶
Package mail implements a GUI email client.
Index ¶
- Variables
- func IMAPToMailAddresses(as []imap.Address) []*mail.Address
- type AddressTextField
- type App
- func (a *App) Compose()
- func (a *App) Delete()
- func (a *App) Forward()
- func (a *App) GetMail()
- func (a *App) Init()
- func (a *App) Label()
- func (a *App) MakeToolbar(p *tree.Plan)
- func (a *App) MarkAsRead()
- func (a *App) MarkAsUnread()
- func (a *App) Reply()
- func (a *App) ReplyAll()
- func (a *App) Send() error
- type Attachment
- type AttachmentButton
- type CacheMessage
- type DisplayMessageFrame
- type Label
- type MessageListItem
- type SendMessage
- type SettingsData
Constants ¶
This section is empty.
Variables ¶
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 ¶
Types ¶
type AddressTextField ¶
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 ¶
App is an email client app.
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) 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 (*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.
type Attachment ¶ added in v0.1.1
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
func (t *DisplayMessageFrame) SetMessage(v *CacheMessage) *DisplayMessageFrame
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
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.
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.