Documentation
¶
Overview ¶
Package jmap fetches email messages from a JMAP Mail server.
https://jmap.io/spec-core.html, https://datatracker.ietf.org/doc/rfc8620/ https://jmap.io/spec-mail.html, https://datatracker.ietf.org/doc/rfc8621/
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Email ¶
type Email struct {
// ID uniquely identifies the message.
ID string `json:"id"`
// BlobID uniquely identifies the message's content.
BlobID string `json:"blobId"`
// Size contains the message's raw data size in octets.
Size uint64 `json:"size"`
// ReceivedAt is the time the message was received by the server.
ReceivedAt time.Time `json:"receivedAt"`
// From contains the message's sender.
From []EmailAddress `json:"from"`
// Subject contains the message's subject.
Subject string `json:"subject"`
}
Email describes an email message on the server.
type EmailAddress ¶
type EmailAddress struct {
// Email contains the actual email address, e.g. "[email protected]".
Email string `json:"email"`
// Name contains the name associated with the address, if any.
Name string `json:"name"`
}
EmailAddress describes an email address in a message header.
type QueryConfig ¶
type QueryConfig struct {
// After is an inclusive lower bound for messages' "receivedAt" dates.
After time.Time
// Before is an exclusive upper bound for messages' "receivedAt" dates.
Before time.Time
// MailboxName is the name of a mailbox that messages must be in, e.g. "Inbox" or "Sent".
MailboxName string
// NotOnlyMailboxNames indicates that messages must be in at least one mailbox other than these.
// Common values are "Trash" and "Spam".
NotOnlyMailboxNames []string
// TotalEmailsOut is set (if non-nil) to the total number of messages before any writes to ch occur.
TotalEmailsOut *uint64
// GetDetails controls whether the ReceivedAt, From, and Subject fields are fetched.
GetDetails bool
}
QueryConfig configures Query's behavior.
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is a JMAP Mail session.
func NewSession ¶
NewSession returns a new JMAP session initialized from the supplied JMAP Session resource URL. The supplied token is sent in an Authorization bearer header.
func (*Session) Download ¶
Download fetches the message identified by blobID. The caller must close the returned io.ReadCloser iff error is nil.
func (*Session) GetMailboxNames ¶
GetMailboxNames returns the names of all mailboxes.
Click to show internal directories.
Click to hide internal directories.