Parse Autodelete-Timer header in MDNs

It is not sent there yet.
This commit is contained in:
Alexander Krotov
2020-01-07 17:21:56 +03:00
parent 6002f54ce1
commit 42d8502531

View File

@@ -818,9 +818,15 @@ impl MimeMessage {
.collect()
});
let autodelete_timer = report_fields
.get_header_value(HeaderDef::AutodeleteTimer)
.and_then(|v| v.parse::<u32>().ok())
.unwrap_or_default();
return Ok(Some(Report {
original_message_id,
additional_message_ids,
autodelete_timer,
}));
}
}
@@ -904,6 +910,11 @@ pub(crate) struct Report {
original_message_id: String,
/// Additional-Message-IDs
additional_message_ids: Vec<String>,
/// MDNs should contain the same autodelete timer value as used in
/// the message they reference. It is used to determine autodelete
/// timer support.
autodelete_timer: u32,
}
pub(crate) fn parse_message_ids(ids: &str) -> Result<Vec<String>> {