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());
continue;
}
let mut push = if let Some(push) = self
let mut identity = if let Some(identity) = self
.get_property::<Object<Value>>(
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));
}
}
}

View file

@ -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
);
}