add more details to fallback NDN

if the NDN has no specific error text,
but we know the failed recipient address,
add these information the final message.
This commit is contained in:
B. Petersen
2022-06-27 13:51:16 +02:00
committed by bjoern
parent ece5eb065a
commit a74c850031
4 changed files with 18 additions and 9 deletions

View File

@@ -1401,11 +1401,11 @@ impl MimeMessage {
}
if let Some(failure_report) = &self.failure_report {
let error = parts.iter().find(|p| p.typ == Viewtype::Text).map_or_else(
|| "Non-Delivery-Notification without further details.".to_string(),
|p| p.msg.clone(),
);
if let Err(e) = message::handle_ndn(context, failure_report, &error).await {
let error = parts
.iter()
.find(|p| p.typ == Viewtype::Text)
.map(|p| p.msg.clone());
if let Err(e) = message::handle_ndn(context, failure_report, error).await {
warn!(context, "Could not handle ndn: {}", e);
}
}