Documentation
¶
Index ¶
- type Attachment
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect() error
- func (c *Client) CopyMessages(mailbox string, ids []string, destMailbox string) error
- func (c *Client) CreateDraft(draft *Draft) (uint32, error)
- func (c *Client) CreateMailbox(name string) error
- func (c *Client) DeleteDraft(ids []string) error
- func (c *Client) DeleteMailbox(name string) error
- func (c *Client) DeleteMessages(mailbox string, ids []string, permanent bool) error
- func (c *Client) DownloadAttachment(mailbox, id string, index int) ([]byte, string, error)
- func (c *Client) GetAttachments(mailbox, id string) ([]Attachment, error)
- func (c *Client) GetDraft(id string) (*Message, error)
- func (c *Client) GetMessage(mailbox string, id string) (*Message, error)
- func (c *Client) GetMessageLabels(messageID string) ([]string, error)
- func (c *Client) GetThread(mailbox, id string) ([]ThreadMessage, error)
- func (c *Client) ListDrafts(limit int) ([]MessageSummary, error)
- func (c *Client) ListMailboxes() ([]MailboxInfo, error)
- func (c *Client) ListMessages(mailbox string, limit, offset int, unreadOnly bool) ([]MessageSummary, error)
- func (c *Client) MoveMessage(mailbox, id, destMailbox string) error
- func (c *Client) MoveMessages(mailbox string, ids []string, destMailbox string) error
- func (c *Client) Search(mailbox string, opts SearchOptions) ([]MessageSummary, error)
- func (c *Client) SearchIDs(mailbox string, opts SearchOptions) ([]string, error)
- func (c *Client) SelectMailbox(name string) (*MailboxStatus, error)
- func (c *Client) SetFlags(mailbox, id string, read, unread, star, unstar bool) error
- func (c *Client) SetFlagsMultiple(mailbox string, ids []string, read, unread, star, unstar bool) error
- func (c *Client) UpdateDraft(id string, draft *Draft) (uint32, error)
- type Draft
- type MailboxInfo
- type MailboxStatus
- type Message
- type MessageSummary
- type SearchOptions
- type ThreadMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CopyMessages ¶
CopyMessages copies messages to a destination folder without removing from source. This is used for adding labels in Proton Bridge, where copying to a Labels/X folder adds that label while keeping the message in its original location.
func (*Client) CreateDraft ¶
CreateDraft creates a new draft in the Drafts folder
func (*Client) CreateMailbox ¶
func (*Client) DeleteDraft ¶
DeleteDraft deletes a draft (permanently)
func (*Client) DeleteMailbox ¶
func (*Client) DeleteMessages ¶
func (*Client) DownloadAttachment ¶
DownloadAttachment downloads a specific attachment by index
func (*Client) GetAttachments ¶
func (c *Client) GetAttachments(mailbox, id string) ([]Attachment, error)
GetAttachments returns a list of attachments for a message without downloading the data
func (*Client) GetMessage ¶
func (*Client) GetMessageLabels ¶
GetMessageLabels returns the labels applied to a message by searching label folders. This searches all Labels/* folders for a message with the same Message-ID.
func (*Client) GetThread ¶
func (c *Client) GetThread(mailbox, id string) ([]ThreadMessage, error)
GetThread retrieves all messages in a conversation thread
func (*Client) ListDrafts ¶
func (c *Client) ListDrafts(limit int) ([]MessageSummary, error)
ListDrafts returns drafts from the Drafts folder
func (*Client) ListMailboxes ¶
func (c *Client) ListMailboxes() ([]MailboxInfo, error)
func (*Client) ListMessages ¶
func (*Client) MoveMessage ¶
func (*Client) MoveMessages ¶
func (*Client) Search ¶
func (c *Client) Search(mailbox string, opts SearchOptions) ([]MessageSummary, error)
func (*Client) SearchIDs ¶
func (c *Client) SearchIDs(mailbox string, opts SearchOptions) ([]string, error)
SearchIDs returns sequence numbers of messages matching the search criteria. This is used for batch operations based on queries.
func (*Client) SelectMailbox ¶
func (c *Client) SelectMailbox(name string) (*MailboxStatus, error)
func (*Client) SetFlagsMultiple ¶
type MailboxInfo ¶
type MailboxStatus ¶
type Message ¶
type Message struct {
UID uint32 `json:"uid"`
SeqNum uint32 `json:"seq_num"`
MessageID string `json:"message_id,omitempty"`
InReplyTo string `json:"in_reply_to,omitempty"`
References []string `json:"references,omitempty"`
From string `json:"from"`
To []string `json:"to"`
CC []string `json:"cc,omitempty"`
Subject string `json:"subject"`
Date string `json:"date"`
DateISO string `json:"date_iso,omitempty"`
Flags []string `json:"flags"`
Labels []string `json:"labels,omitempty"`
TextBody string `json:"text_body,omitempty"`
HTMLBody string `json:"html_body,omitempty"`
RawBody []byte `json:"-"`
Attachments []Attachment `json:"attachments,omitempty"`
}
type MessageSummary ¶
type SearchOptions ¶
type SearchOptions struct {
Query string // General query (searches body text)
From string // Filter by sender
To string // Filter by recipient
Subject string // Filter by subject
Body string // Search in message body
Since string // Messages since date (YYYY-MM-DD)
Before string // Messages before date (YYYY-MM-DD)
HasAttachments bool // Only messages with attachments
LargerThan int64 // Messages larger than this size in bytes
SmallerThan int64 // Messages smaller than this size in bytes
UseOr bool // Combine filters with OR instead of AND
Negate bool // Negate the entire search
}
SearchOptions contains all search criteria for the Search method
type ThreadMessage ¶
type ThreadMessage struct {
UID uint32 `json:"uid"`
SeqNum uint32 `json:"seq_num"`
MessageID string `json:"message_id,omitempty"`
From string `json:"from"`
To string `json:"to"`
Subject string `json:"subject"`
Date string `json:"date"`
DateISO string `json:"date_iso,omitempty"`
Body string `json:"body,omitempty"`
Seen bool `json:"seen"`
}
ThreadMessage is a message with body text for thread display