crabmail

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

commit c53d303372dadb6dc8ebf70fc4b775a39c751b3f
parent 9367f0aa9ae9baa4a95346ce8b03095959d4c436
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Tue, 29 Mar 2022 20:34:37 -0700

some stufz

Diffstat:
MTODO | 2+-
Msrc/main.rs | 10+++++-----
Msrc/models.rs | 4++++
Msrc/style.css | 2+-
Msrc/templates/html.rs | 4++--
5 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/TODO b/TODO @@ -1,8 +1,8 @@ TODO ==== -replace eml export with mbox for some reason? atom get item href working on list URL encode spaces in links for gemini export +dont export empty fields later ---- diff --git a/src/main.rs b/src/main.rs @@ -2,7 +2,7 @@ // i am not very good at rust // that is ok though #[forbid(unsafe_code)] -use anyhow::{Context, Result}; +use anyhow::Result; use mail_parser::Message; use maildir::Maildir; use std::collections::HashSet; @@ -152,10 +152,10 @@ impl List { self.thread_topics.sort_by_key(|t| t.last_reply); self.thread_topics.reverse(); self.recent_messages = self.get_recent_messages(); - for msg in &mut self.recent_messages { - // TBD - // msg.set_url(&self, &summary); // awkward) // hacky - } + // for msg in &mut self.recent_messages { + // TBD + // msg.set_url(&self, &summary); // awkward) // hacky + // } // Remove deleted stuff for dir in vec![message_dir, thread_dir] { for entry in fs::read_dir(&dir).unwrap() { diff --git a/src/models.rs b/src/models.rs @@ -164,7 +164,11 @@ impl StrMessage { // Figure out body export and content-transfer... message.text_body(&self.body); let mut output = Vec::new(); + // Dummy data for mbox + output.extend_from_slice(&b"From mboxrd@z Thu Jan 1 00:00:00 1970\n"[..]); message.write_to(&mut output).unwrap(); + // for mbox + output.push(b'\n'); output } diff --git a/src/style.css b/src/style.css @@ -66,7 +66,7 @@ a { } .bigger { - font-size: 1.2rem; + font-size: 1.1rem; } .light { diff --git a/src/templates/html.rs b/src/templates/html.rs @@ -22,7 +22,7 @@ const HEADER: &str = r#"<!DOCTYPE html> const FOOTER: &str = r#" Archive generated with <a href='https://crabmail.flounder.online/'>crabmail</a> -</body> +// </body> </html> "#; @@ -245,7 +245,7 @@ impl Thread { {extra_headers} </details> <a class="bold" href="{mailto}">Reply</a> - [<a href="../messages/{msg_path}.eml">Export</a>] + [<a href="../messages/{msg_path}.mbox">Export</a>] </div> <div class="email-body"> {body}