crabmail

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

commit 6caab6b7dd8024e9c2a431b41b4b2a99c12e9df9
parent 2d9e37584bf004bf155bf03ec0ead01ff27129fa
Author: alex wennerberg <alex@alexwennerberg.com>
Date:   Tue, 29 Mar 2022 19:50:02 -0700

cleanup cleanup

Diffstat:
MREADME.md | 6++++++
MTODO | 3++-
Msrc/main.rs | 5++---
Msrc/models.rs | 3++-
Msrc/templates/html.rs | 1-
5 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/README.md b/README.md @@ -54,6 +54,12 @@ crabmail lists Open `site/index.html` in a web browser +## NOTES + +This is only tested on Linux. Notably: Any character other than "/" is allowed +in filenames used in message-id. Make sure this doesn't break anything or cause +a security vuln on your filesystem. + ## Contributing For patches, use `git-send-email` or `git-format-patch` diff --git a/TODO b/TODO @@ -1,8 +1,9 @@ TODO ==== +replace eml export with mbox for some reason? audit for security (path bugs, html escape bugs) atom get item href working on list -fix bottom anchor/ latest link +remove latest anchor. use ur keyboard; URL encode spaces in links for gemini export later diff --git a/src/main.rs b/src/main.rs @@ -47,7 +47,6 @@ impl Lists { } for list in &mut self.lists { list.persist(); - // todo somewhat awkward } } } @@ -145,8 +144,8 @@ impl List { } for msg in thread.messages { - let eml = append_ext("eml", &message_dir.join(&msg.pathescape_msg_id())); - write_if_unchanged(&eml, &msg.export_eml()); + let eml = append_ext("mbox", &message_dir.join(&msg.pathescape_msg_id())); + write_if_unchanged(&eml, &msg.export_mbox()); files_written.insert(eml); } } diff --git a/src/models.rs b/src/models.rs @@ -136,7 +136,8 @@ impl StrMessage { PathBuf::from(self.id.replace("/", ";")) } // wonky - pub fn export_eml(&self) -> Vec<u8> { + // for some reason mbox is used over eml for things like git, mutt, etc + pub fn export_mbox(&self) -> Vec<u8> { let mut message = MessageBuilder::new(); if self.flowed { message.format_flowed(); diff --git a/src/templates/html.rs b/src/templates/html.rs @@ -177,7 +177,6 @@ impl Thread { </h1> <div> <a href="../">Back</a> - <a href='#bottom'>Latest</a> <hr> <div> "#;