Expand description
RFC 8621 JMAP for Mail data types.
Provides Email, Mailbox, Thread, Identity, EmailSubmission,
and SearchSnippet — the core object types defined by
RFC 8621.
This crate is types-only: no method handlers, no async, no network I/O.
It sits between jmap-types (shared wire primitives) and jmap-mail-server
(method handlers).
All types implement serde::Serialize and serde::Deserialize with the
camelCase field names required by the JMAP wire format.
§Example
use jmap_mail_types::Mailbox;
let json = r#"{
"id": "mb1",
"name": "Inbox",
"role": "inbox",
"sortOrder": 10,
"totalEmails": 42,
"unreadEmails": 3,
"totalThreads": 20,
"unreadThreads": 2,
"myRights": {
"mayReadItems": true,
"mayAddItems": true,
"mayRemoveItems": true,
"maySetSeen": true,
"maySetKeywords": true,
"mayCreateChild": true,
"mayRename": true,
"mayDelete": false,
"maySubmit": false
},
"isSubscribed": true
}"#;
let mailbox: Mailbox = serde_json::from_str(json).unwrap();
assert_eq!(mailbox.name, "Inbox");Structs§
- Address
- SMTP envelope address with optional MAIL FROM / RCPT TO parameters (RFC 8621 §7).
- Delivery
Status - Per-recipient delivery status for an
EmailSubmission(RFC 8621 §7). - An Email object (RFC 8621 §4.1).
- Email
Address - A parsed email address (RFC 8621 §4.1.2.3).
- Email
Address Group - A named group of email addresses (RFC 8621 §4.1.2.4).
- Email
Body Part - One MIME body part within an Email (RFC 8621 §4.1.4).
- Email
Body Value - The decoded text content of one body part (RFC 8621 §4.1.4).
- Email
Comparator - Sort comparator for Email/query (RFC 8621 §4.4.2).
- Email
Filter Condition - Filter condition for Email objects (RFC 8621 §4.4.1).
- Email
Header - A single RFC 5322 header field (RFC 8621 §4.1.3).
- Email
Submission - Represents the submission of an Email for delivery (RFC 8621 §7).
- Email
Submission Comparator - Sort comparator for
EmailSubmission/query(RFC 8621 §7.3). - Email
Submission Filter Condition - Filter condition for EmailSubmission/query (RFC 8621 §7.3).
- Envelope
- SMTP envelope for an
EmailSubmission(RFC 8621 §7). - Filter
Operator - Logical combination of filters (RFC 8620 §5.5).
- Identity
- An RFC 8621 §6 Identity object.
- Keyword
- A JMAP keyword string (RFC 8621 §4.1.1).
- Mail
Account Capability - Account-level Mail capability (RFC 8621 §1.3.1).
- Mail
Capability - Session-level Mail capability (RFC 8621 §1.3.1).
- Mailbox
- A JMAP Mailbox object (RFC 8621 §2).
- Mailbox
Comparator - Sort comparator for
Mailbox/query(RFC 8621 §2.3). - Mailbox
Filter Condition - Filter condition for
Mailbox/query(RFC 8621 §2.3). - Mailbox
Rights - Access control rights the authenticated user holds for a Mailbox (RFC 8621 §2).
- Search
Snippet - A search result snippet for one Email (RFC 8621 §5).
- Search
Snippet GetResponse - RFC 8621 §5.1 —
SearchSnippet/getresponse. - Sieve
Script Comparator - Sort comparator for
SieveScript/query(RFC 9661 §2.5). - Submission
Account Capability - Account-level Submission capability (RFC 8621 §1.3.2).
- Submission
Capability - Session-level Submission capability (RFC 8621 §1.3.2).
- Thread
- A Thread object as defined in RFC 8621 §3.
- Vacation
Response - Vacation-response settings for an account (RFC 8621 §8).
- Vacation
Response Capability - Session-level VacationResponse capability (RFC 8621 §1.3.3).
Enums§
- Comparator
Property - The property to sort by in an
EmailComparator(RFC 8621 §4.4.2). - Delivered
- Delivery status of a message to a recipient (RFC 8621 §7,
deliveredfield). - Displayed
- Display status of a message to a recipient (RFC 8621 §7,
displayedfield). - Email
Property - Property selector for
crate::Email/getand/set. - Email
Submission Comparator Property - The property to sort by in an
EmailSubmissionComparator. - Email
Submission Property - Property selector for
crate::EmailSubmission/getand/set. - Filter
- A filter node: either a logical operator combining sub-filters, or a type-specific condition object (RFC 8620 §5.5).
- Identity
Property - Property selector for
crate::Identity/getand/set. - Keyword
Error - Error returned by
Keyword::try_newwhen the input violates RFC 8621 §4.1.1. - Mailbox
Comparator Property - The property to sort by in a
MailboxComparator. - Mailbox
Property - Property selector for
crate::Mailbox/getand/set. - Mailbox
Role - The role of a Mailbox, identifying its common purpose (RFC 8621 §2).
- Operator
- Logical operator for combining filter conditions (RFC 8620 §5.5).
- Search
Snippet Property - Property selector for
crate::SearchSnippet/get. - Sieve
Script Comparator Property - The property to sort by in a
SieveScriptComparator. - Thread
Property - Property selector for
crate::Thread/get. - Undo
Status - Whether an
EmailSubmissionmay still be canceled (RFC 8621 §7). - Vacation
Response Property - Property selector for
crate::VacationResponse/getand/set.
Constants§
- ANSWERED
- The Email has been replied to (RFC 8621 §4.1.1).
- DRAFT
- The Email is a draft being composed by the user (RFC 8621 §4.1.1).
- FLAGGED
- The Email has been flagged for urgent/special attention (RFC 8621 §4.1.1).
- FORWARDED
- The Email has been forwarded (RFC 8621 §4.1.1 / IANA registry).
- JMAP_
MAIL_ URI - Capability URI for core JMAP for Mail support (RFC 8621 §1.3.1).
- JMAP_
SUBMISSION_ URI - Capability URI for the JMAP Email Submission extension (RFC 8621 §1.3.2).
- JMAP_
VACATIONRESPONSE_ URI - Capability URI for the JMAP Vacation Response extension (RFC 8621 §1.3.3).
- JUNK
- The Email is definitely spam (RFC 8621 §4.1.1 / IANA registry).
- NOT_
JUNK - The Email is definitely not spam (RFC 8621 §4.1.1 / IANA registry).
- PHISHING
- The Email is highly likely to be phishing (RFC 8621 §4.1.1 / IANA registry).
- SEEN
- The Email has been read (RFC 8621 §4.1.1).
Type Aliases§
- Email
Filter - Concrete filter type for Email/query (RFC 8621 §4.4).
- Email
Submission Filter - Concrete filter type for EmailSubmission/query (RFC 8621 §7.3).
- Mailbox
Filter - Concrete filter type for Mailbox/query (RFC 8621 §2.3).