From 7535caf5da493d68f5c5b7fdd0fd44cbfffe7d0d Mon Sep 17 00:00:00 2001 From: mdecimus Date: Thu, 16 May 2024 11:57:40 +0200 Subject: [PATCH] Fix: JMAP identities should not return null signatures --- crates/jmap/src/identity/get.rs | 15 ++++++++++++--- crates/smtp/src/reporting/tls.rs | 2 +- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/crates/jmap/src/identity/get.rs b/crates/jmap/src/identity/get.rs index 1be070e6..e7d86ae4 100644 --- a/crates/jmap/src/identity/get.rs +++ b/crates/jmap/src/identity/get.rs @@ -81,7 +81,7 @@ impl JMAP { response.not_found.push(id.into()); continue; } - let mut push = if let Some(push) = self + let mut identity = if let Some(identity) = self .get_property::>( account_id, Collection::Identity, @@ -90,7 +90,7 @@ impl JMAP { ) .await? { - push + identity } else { response.not_found.push(id.into()); continue; @@ -104,8 +104,17 @@ impl JMAP { Property::MayDelete => { result.append(Property::MayDelete, Value::Bool(true)); } + Property::TextSignature | Property::HtmlSignature => { + result.append( + property.clone(), + identity + .properties + .remove(property) + .unwrap_or(Value::Text(String::new())), + ); + } property => { - result.append(property.clone(), push.remove(property)); + result.append(property.clone(), identity.remove(property)); } } } diff --git a/crates/smtp/src/reporting/tls.rs b/crates/smtp/src/reporting/tls.rs index 30e29af3..e2fee08b 100644 --- a/crates/smtp/src/reporting/tls.rs +++ b/crates/smtp/src/reporting/tls.rs @@ -498,7 +498,7 @@ impl SMTP { tracing::error!( context = "report", event = "error", - "Failed to write DMARC report event: {}", + "Failed to write TLS report event: {}", err ); }