Index: Cargo.lock ================================================================== --- Cargo.lock +++ Cargo.lock @@ -1842,11 +1842,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smtp2tg" -version = "0.3.2" +version = "0.3.3" dependencies = [ "anyhow", "async-std", "config", "mail-parser", Index: Cargo.toml ================================================================== --- Cargo.toml +++ Cargo.toml @@ -1,8 +1,8 @@ [package] name = "smtp2tg" -version = "0.3.2" +version = "0.3.3" authors = [ "arcade" ] edition = "2021" [dependencies] anyhow = "1.0.86" Index: src/main.rs ================================================================== --- src/main.rs +++ src/main.rs @@ -145,25 +145,27 @@ // prepating message header let mut reply: Vec> = vec![]; if self.fields.contains("subject") { if let Some(subject) = mail.subject() { - reply.push(format!("**Subject:** `{}`", subject).into()); + reply.push(format!("__*Subject:*__ `{}`", subject).into()); } else if let Some(thread) = mail.thread_name() { - reply.push(format!("**Thread:** `{}`", thread).into()); + reply.push(format!("__*Thread:*__ `{}`", thread).into()); } } + let mut short_headers: Vec> = vec![]; + // do we need to replace spaces here? if self.fields.contains("from") { - reply.push(format!("**From:** `{}`", headers.from).into()); + short_headers.push(format!("__*From:*__ `{}`", headers.from).into()); } if self.fields.contains("date") { if let Some(date) = mail.date() { - reply.push(format!("**Date:** `{}`", date).into()); + short_headers.push(format!("__*Date:*__ `{}`", date).into()); } } - reply.push("".into()); - let header_size = reply.join("\n").len() + 1; + reply.push(short_headers.join(" ").into()); + let header_size = reply.join(" ").len() + 1; let html_parts = mail.html_body_count(); let text_parts = mail.text_body_count(); let attachments = mail.attachment_count(); if html_parts != text_parts {