server: handle multipart/mixed with an html or text subpart

This commit is contained in:
Bill Thiede 2023-11-26 21:09:56 -08:00
parent 87d687cde5
commit e8c58bdbd0

View File

@ -325,6 +325,14 @@ fn extract_mixed(m: &ParsedMail) -> Result<Body, Error> {
return extract_related(sp); 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()) Err("extract_mixed".into())
} }