crabmail

Static HTML email archive viewer in Rust
git clone git://git.alexwennerberg.com/crabmail
Log | Files | Refs | README | LICENSE

commit 623b062a669f5342a720c4c3d2a2dcce68f5cbb3
parent 1858c686995ad3618ccdb89e5c4484c75c3a5e5d
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sun,  2 Jan 2022 13:07:57 -0800

fix replies

Diffstat:
Msrc/main.rs | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs @@ -444,7 +444,12 @@ fn local_parse_email(parsed_mail: &ParsedMail) -> Result<Email> { return Err(anyhow!("bad message ID")); } // Assume 1 in-reply-to header. a reasonable assumption - let in_reply_to = headers.get_first_value("in-reply-to"); + let in_reply_to = headers.get_first_value("in-reply-to").and_then(|m| { + msgidparse(&m).ok().and_then(|i| match i.len() { + 0 => None, + _ => Some(i[0].clone()), + }) + }); let subject = headers .get_first_value("subject") .unwrap_or("(no subject)".to_owned());