Skip to main content

io_jmap/rfc8621/
identity.rs

1//! JMAP for Mail: Identity (RFC 8621 §6).
2
3use alloc::{string::String, vec::Vec};
4
5use serde::{Deserialize, Serialize};
6
7use crate::rfc8621::email::JmapEmailAddress;
8
9pub mod get;
10pub mod set;
11
12/// A JMAP Identity object (RFC 8621 §6.1).
13///
14/// An Identity describes a sender identity the user can send email
15/// from (name, email address, signature, etc.).
16#[derive(Clone, Debug, Serialize, Deserialize)]
17#[serde(rename_all = "camelCase")]
18pub struct JmapIdentity {
19    /// The server-assigned ID.
20    pub id: String,
21    /// The display name for the sender.
22    pub name: String,
23    /// The email address for the sender.
24    pub email: String,
25    /// `Reply-To` addresses to set on outgoing email.
26    pub reply_to: Option<Vec<JmapEmailAddress>>,
27    /// `Bcc` addresses to add to all outgoing email.
28    pub bcc: Option<Vec<JmapEmailAddress>>,
29    /// Plaintext signature to append to outgoing email.
30    pub text_signature: Option<String>,
31    /// HTML signature to append to outgoing email.
32    pub html_signature: Option<String>,
33    /// Whether the user may delete this identity.
34    #[serde(default)]
35    pub may_delete: bool,
36}