server: fix inline image loading

This commit is contained in:
Bill Thiede 2024-08-17 16:33:53 -07:00
parent 632f64261e
commit 5279578c64

View File

@ -465,8 +465,10 @@ fn extract_mixed(m: &ParsedMail, part_addr: &mut Vec<String>) -> Result<Body, Se
.unwrap_or("".to_string()); .unwrap_or("".to_string());
// Only add inline images, attachments are handled as an attribute of the top level Message and rendered separate client-side. // Only add inline images, attachments are handled as an attribute of the top level Message and rendered separate client-side.
if pcd.disposition == mailparse::DispositionType::Inline { if pcd.disposition == mailparse::DispositionType::Inline {
// TODO: make URL generation more programatic based on what the frontend has
// mapped
parts.push(Body::html(format!( parts.push(Body::html(format!(
r#"<img src="/view/attachment/{}/{}/{filename}">"#, r#"<img src="/api/view/attachment/{}/{}/{filename}">"#,
part_addr[0], part_addr[0],
part_addr part_addr
.iter() .iter()