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#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
18#[serde(rename_all = "camelCase")]
19pub struct JmapIdentity {
20 /// The server-assigned ID.
21 pub id: String,
22 /// The display name for the sender.
23 pub name: String,
24 /// The email address for the sender.
25 pub email: String,
26 /// `Reply-To` addresses to set on outgoing email.
27 pub reply_to: Option<Vec<JmapEmailAddress>>,
28 /// `Bcc` addresses to add to all outgoing email.
29 pub bcc: Option<Vec<JmapEmailAddress>>,
30 /// Plaintext signature to append to outgoing email.
31 pub text_signature: Option<String>,
32 /// HTML signature to append to outgoing email.
33 pub html_signature: Option<String>,
34 /// Whether the user may delete this identity.
35 #[serde(default)]
36 pub may_delete: bool,
37}