Documentation
¶
Overview ¶
Package mailview turns JMAP emails into compact, model-friendly values.
Index ¶
- Variables
- func Address(a *mail.Address) string
- func Addresses(as []*mail.Address) []string
- func BodyText(e *email.Email) (text string, fromHTML, truncated bool)
- func Flags(kw map[string]bool) []string
- func HTMLToText(html string) string
- func MailboxNames(ids map[jmap.ID]bool, names map[jmap.ID]string) []string
- func Truncate(s string, max int) (string, bool)
- type Attachment
- type Message
- type Summary
Constants ¶
This section is empty.
Variables ¶
View Source
var BodyProperties = []string{"partId", "blobId", "size", "name", "type", "charset", "disposition", "cid"}
BodyProperties are the body part properties fetched with FullProperties.
View Source
var FullProperties = []string{"id", "threadId", "mailboxIds", "keywords", "receivedAt", "sentAt", "from", "to", "cc", "bcc", "replyTo", "sender",
"subject", "messageId", "inReplyTo", "references", "textBody", "htmlBody", "attachments", "bodyValues", "size", "hasAttachment", "preview"}
FullProperties are the Email properties needed by Full.
View Source
var SummaryProperties = []string{"id", "threadId", "mailboxIds", "keywords", "receivedAt", "from", "to", "subject", "preview", "hasAttachment", "attachments", "size"}
SummaryProperties are the Email properties needed by Summarize.
Functions ¶
func BodyText ¶
BodyText returns the plain text of an email, converting HTML when no text part exists.
func HTMLToText ¶
HTMLToText renders HTML as plain text without executing anything.
func MailboxNames ¶
MailboxNames maps the ids of an email to mailbox names.
Types ¶
type Attachment ¶
type Attachment struct {
ID string `json:"id"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Size uint64 `json:"size"`
}
Attachment describes a downloadable part.
type Message ¶
type Message struct {
ID string `json:"id"`
Thread string `json:"thread"`
Mailboxes []string `json:"mailboxes,omitempty"`
Flags []string `json:"flags,omitempty"`
ReceivedAt string `json:"received_at,omitempty"`
SentAt string `json:"sent_at,omitempty"`
From []string `json:"from,omitempty"`
Sender []string `json:"sender,omitempty"`
ReplyTo []string `json:"reply_to,omitempty"`
To []string `json:"to,omitempty"`
Cc []string `json:"cc,omitempty"`
Bcc []string `json:"bcc,omitempty"`
Subject string `json:"subject"`
MessageID []string `json:"message_id,omitempty"`
InReplyTo []string `json:"in_reply_to,omitempty"`
References []string `json:"references,omitempty"`
Body string `json:"body"`
BodyTruncated bool `json:"body_truncated,omitempty"`
BodyLength int `json:"body_length"`
BodyFromHTML bool `json:"body_from_html,omitempty"`
Attachments []Attachment `json:"attachments,omitempty"`
}
Message is the full form of an email.
type Summary ¶
type Summary struct {
ID string `json:"id"`
Thread string `json:"thread"`
Date string `json:"date,omitempty"`
From string `json:"from,omitempty"`
To []string `json:"to,omitempty"`
Subject string `json:"subject"`
Preview string `json:"preview,omitempty"`
Flags []string `json:"flags,omitempty"`
Mailboxes []string `json:"mailboxes,omitempty"`
Attachments int `json:"attachments,omitempty"`
Size uint64 `json:"size,omitempty"`
}
Summary is the compact form of an email returned by searches.
Click to show internal directories.
Click to hide internal directories.