crabmail

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

commit 904dea9b135bf9f60b71d9e842145c73c7d669bc
parent a6a3bbaf8b3e76c2e6fb30d2bec4b1028d47fcec
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat, 31 Jul 2021 21:11:12 -0700

Add subpart parsing

Diffstat:
Msrc/filters.rs | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/filters.rs b/src/filters.rs @@ -8,5 +8,11 @@ pub fn get_header(email: &&ParsedMail, header: &str) -> askama::Result<String> { } pub fn get_body(email: &&ParsedMail) -> askama::Result<String> { + // TODO mimetypes + if email.subparts.len() > 0 { + return Ok(email.subparts[0].get_body().unwrap_or("".to_string())); + } Ok(email.get_body().unwrap_or("".to_string())) } + +// pub fn get_attachment(email: &&ParsedMail) -> askama::Result<String> {}