crabmail

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

commit edaa566e1ae59e75d14950e4ba69de3623237275
parent 91b97744b36a93bd5d2cbe31526a8b0986266a47
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Sat, 19 Mar 2022 20:09:41 -0700

format flowed build eml

Diffstat:
MCargo.lock | 3+--
MCargo.toml | 3+--
MTODO | 4+---
Msrc/models.rs | 1+
Msrc/templates/gmi.rs | 3++-
5 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -85,8 +85,7 @@ dependencies = [ [[package]] name = "mail-builder" version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a0b1038ef981145cfec88536cc5b29aa6ab0a8131d42cc5d7d2738455d720e" +source = "git+https://github.com/alexwennerberg/mail-builder#8ab564c9d4b11b11c27d2f6be73b0c0187537564" dependencies = [ "chrono", "gethostname", diff --git a/Cargo.toml b/Cargo.toml @@ -12,8 +12,7 @@ anyhow = "1.0.52" nanotemplate = "*" # using my fork just to upstream patches faster mail-parser = {git = "https://github.com/alexwennerberg/mail-parser", default-features=false} -# TODO cleanup dependencies -mail-builder = "*" +mail-builder = {git = "https://github.com/alexwennerberg/mail-builder"} # Small, effective dependencies, little benefit to vendoring linkify = "0.8.0" diff --git a/TODO b/TODO @@ -2,14 +2,12 @@ TODO ==== understand content-transfer-encoding for eml body -figure out whats up with format=flowed. update library? - use get_thread_name? get export working -> use mail-builder (fork it and/or cut deps) get reply link working allow mbox/single folder input atom feeds working -gemini pages +gemini pages finish up paginate list home create list home page diff --git a/src/models.rs b/src/models.rs @@ -126,6 +126,7 @@ impl StrMessage { // wonky pub fn export_eml(&self) -> Vec<u8> { let mut message = MessageBuilder::new(); + message.format_flowed(); let from = self.from.name.clone().unwrap_or(String::new()); message.from((from.as_str(), self.from.address.as_str())); message.to("jane@doe.com"); diff --git a/src/templates/gmi.rs b/src/templates/gmi.rs @@ -56,7 +56,8 @@ Cc: ... } } -// TODO ... +// Convert body to gemini +// gonna be complex fn escape_body(s: &str) -> String { let mut out = " ".to_string(); out.push_str(&s.replace("\n", "\n "));