From 1c36bd61a8f30b147500c47f2e593ae89431c042 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 7 Oct 2018 17:44:58 +0200 Subject: Fix: Check whether header value contains msgid This is better because of the "References:" header field. The field may contain several entries. As the `mailparse` library does not return a `Vec<>` of values here, we simlpy use the `String::contains()` function to check whether the mails could be related. Signed-off-by: Matthias Beyer --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 717c715..bf60e85 100644 --- a/src/main.rs +++ b/src/main.rs @@ -115,12 +115,12 @@ fn main() { || key == "Message-Id" || key == "References" { - let value = hdr.get_value().unwrap_or_else(|e| { - eprintln!("Failed to get mail header value: {} - {:?}", path.display(), e); - exit(1) - }); - - value == msgid + hdr.get_value() + .unwrap_or_else(|e| { + eprintln!("Failed to get mail header value: {} - {:?}", path.display(), e); + exit(1) + }) + .contains(msgid) } else { false } -- cgit v1.2.3