mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 01:16:31 +03:00
more functional
This commit is contained in:
@@ -910,18 +910,18 @@ impl MimeMessage {
|
||||
.to_ascii_lowercase()
|
||||
.contains("daemon")
|
||||
&& self.failure_report.is_none()
|
||||
{
|
||||
for line in self
|
||||
.parts
|
||||
.iter()
|
||||
.filter_map(|p| p.msg_raw.as_ref())
|
||||
.flat_map(|p| p.lines())
|
||||
{
|
||||
lazy_static! {
|
||||
static ref RE: regex::Regex = regex::Regex::new(r"Message-ID:(.*)").unwrap();
|
||||
}
|
||||
if let Some(c) = RE.captures(line) {
|
||||
if let Ok(original_message_id) = parse_message_id(&c[1]) {
|
||||
for captures in self
|
||||
.parts
|
||||
.iter()
|
||||
.filter_map(|part| part.msg_raw.as_ref())
|
||||
.flat_map(|part| part.lines())
|
||||
.filter_map(|line| RE.captures(line))
|
||||
{
|
||||
if let Ok(original_message_id) = parse_message_id(&captures[1]) {
|
||||
if let Ok(Some(_)) =
|
||||
message::rfc724_mid_exists(context, &original_message_id).await
|
||||
{
|
||||
@@ -933,7 +933,6 @@ impl MimeMessage {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
None // Always return None, we just return anything so that we can use the '?' operator.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user