From e8c58bdbd0b6db02d703e446977b602c76b436da Mon Sep 17 00:00:00 2001 From: Bill Thiede Date: Sun, 26 Nov 2023 21:09:56 -0800 Subject: [PATCH] server: handle multipart/mixed with an html or text subpart --- server/src/graphql.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server/src/graphql.rs b/server/src/graphql.rs index c6ec79e..e8ca082 100644 --- a/server/src/graphql.rs +++ b/server/src/graphql.rs @@ -325,6 +325,14 @@ fn extract_mixed(m: &ParsedMail) -> Result { return extract_related(sp); } } + for sp in &m.subparts { + let body = sp.get_body()?; + match sp.ctype.mimetype.as_str() { + "text/plain" => return Ok(Body::PlainText(PlainText { text: body })), + "text/html" => return Ok(Body::Html(Html { html: body })), + _ => (), + } + } Err("extract_mixed".into()) }