Skip to main content

Crate jmap_mail_types

Crate jmap_mail_types 

Source
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).
DeliveryStatus
Per-recipient delivery status for an EmailSubmission (RFC 8621 §7).
Email
An Email object (RFC 8621 §4.1).
EmailAddress
A parsed email address (RFC 8621 §4.1.2.3).
EmailAddressGroup
A named group of email addresses (RFC 8621 §4.1.2.4).
EmailBodyPart
One MIME body part within an Email (RFC 8621 §4.1.4).
EmailBodyValue
The decoded text content of one body part (RFC 8621 §4.1.4).
EmailComparator
Sort comparator for Email/query (RFC 8621 §4.4.2).
EmailFilterCondition
Filter condition for Email objects (RFC 8621 §4.4.1).
EmailHeader
A single RFC 5322 header field (RFC 8621 §4.1.3).
EmailSubmission
Represents the submission of an Email for delivery (RFC 8621 §7).
EmailSubmissionComparator
Sort comparator for EmailSubmission/query (RFC 8621 §7.3).
EmailSubmissionFilterCondition
Filter condition for EmailSubmission/query (RFC 8621 §7.3).
Envelope
SMTP envelope for an EmailSubmission (RFC 8621 §7).
FilterOperator
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).
MailAccountCapability
Account-level Mail capability (RFC 8621 §1.3.1).
MailCapability
Session-level Mail capability (RFC 8621 §1.3.1).
Mailbox
A JMAP Mailbox object (RFC 8621 §2).
MailboxComparator
Sort comparator for Mailbox/query (RFC 8621 §2.3).
MailboxFilterCondition
Filter condition for Mailbox/query (RFC 8621 §2.3).
MailboxRights
Access control rights the authenticated user holds for a Mailbox (RFC 8621 §2).
SearchSnippet
A search result snippet for one Email (RFC 8621 §5).
SearchSnippetGetResponse
RFC 8621 §5.1 — SearchSnippet/get response.
SieveScriptComparator
Sort comparator for SieveScript/query (RFC 9661 §2.5).
SubmissionAccountCapability
Account-level Submission capability (RFC 8621 §1.3.2).
SubmissionCapability
Session-level Submission capability (RFC 8621 §1.3.2).
Thread
A Thread object as defined in RFC 8621 §3.
VacationResponse
Vacation-response settings for an account (RFC 8621 §8).
VacationResponseCapability
Session-level VacationResponse capability (RFC 8621 §1.3.3).

Enums§

ComparatorProperty
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, delivered field).
Displayed
Display status of a message to a recipient (RFC 8621 §7, displayed field).
EmailProperty
Property selector for crate::Email /get and /set.
EmailSubmissionComparatorProperty
The property to sort by in an EmailSubmissionComparator.
EmailSubmissionProperty
Property selector for crate::EmailSubmission /get and /set.
Filter
A filter node: either a logical operator combining sub-filters, or a type-specific condition object (RFC 8620 §5.5).
IdentityProperty
Property selector for crate::Identity /get and /set.
KeywordError
Error returned by Keyword::try_new when the input violates RFC 8621 §4.1.1.
MailboxComparatorProperty
The property to sort by in a MailboxComparator.
MailboxProperty
Property selector for crate::Mailbox /get and /set.
MailboxRole
The role of a Mailbox, identifying its common purpose (RFC 8621 §2).
Operator
Logical operator for combining filter conditions (RFC 8620 §5.5).
SearchSnippetProperty
Property selector for crate::SearchSnippet /get.
SieveScriptComparatorProperty
The property to sort by in a SieveScriptComparator.
ThreadProperty
Property selector for crate::Thread /get.
UndoStatus
Whether an EmailSubmission may still be canceled (RFC 8621 §7).
VacationResponseProperty
Property selector for crate::VacationResponse /get and /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§

EmailFilter
Concrete filter type for Email/query (RFC 8621 §4.4).
EmailSubmissionFilter
Concrete filter type for EmailSubmission/query (RFC 8621 §7.3).
MailboxFilter
Concrete filter type for Mailbox/query (RFC 8621 §2.3).