Fix: JMAP identities should not return null signatures

This commit is contained in:
mdecimus
2024-05-16 11:57:40 +02:00
parent 7328ba8dd5
commit 7535caf5da
2 changed files with 13 additions and 4 deletions

View File

@@ -81,7 +81,7 @@ impl JMAP {
response.not_found.push(id.into()); response.not_found.push(id.into());
continue; continue;
} }
let mut push = if let Some(push) = self let mut identity = if let Some(identity) = self
.get_property::<Object<Value>>( .get_property::<Object<Value>>(
account_id, account_id,
Collection::Identity, Collection::Identity,
@@ -90,7 +90,7 @@ impl JMAP {
) )
.await? .await?
{ {
push identity
} else { } else {
response.not_found.push(id.into()); response.not_found.push(id.into());
continue; continue;
@@ -104,8 +104,17 @@ impl JMAP {
Property::MayDelete => { Property::MayDelete => {
result.append(Property::MayDelete, Value::Bool(true)); 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 => { property => {
result.append(property.clone(), push.remove(property)); result.append(property.clone(), identity.remove(property));
} }
} }
} }

View File

@@ -498,7 +498,7 @@ impl SMTP {
tracing::error!( tracing::error!(
context = "report", context = "report",
event = "error", event = "error",
"Failed to write DMARC report event: {}", "Failed to write TLS report event: {}",
err err
); );
} }