Skip to content

Commit

Permalink
v2.0.1
Browse files Browse the repository at this point in the history
- Email parsing fix if missing header info
  • Loading branch information
battleoverflow committed Oct 9, 2023
1 parent c45f8e7 commit 3241519
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mercy"
description = "Mercy is an open-source Rust crate and CLI for building cybersecurity tools, assessment projects, and testing infrastructure."
version = "2.0.0"
version = "2.0.1"
edition = "2021"
author = "azazelm3dj3d"
license = "BSD-2-Clause"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Mercy is an open source Rust crate and CLI designed for building cybersecurity t
Since Mercy is a standard crate, it can easily be used in any project already initialized with Cargo. Simply add the following line to your `Cargo.toml` file:

```toml
mercy = "2.0.0"
mercy = "2.0.1"
```

Once the `Cargo.toml` file is updated, you can import the crate and use the provided methods by running `cargo run`. There are lots of different examples available below.
Expand Down
14 changes: 7 additions & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ use mailparse::*;

/// Learn more about the crate
pub fn source() -> String {
const VERSION: &str = "2.0.0";
const VERSION: &str = "2.0.1";
const AUTHOR: &str = "azazelm3dj3d (https://github.com/azazelm3dj3d)";
return format!("Author: {}\nVersion: {}\nDocumentation: https://docs.rs/crate/mercy/latest", AUTHOR, VERSION);
}
Expand Down Expand Up @@ -464,12 +464,12 @@ fn parse_email_content(content: &str) -> String {
let parse_content: ParsedMail = parse_mail(&vec_binding).unwrap();

let parsed_content: String = format!("Subject: {}\nFrom: {}\nTo: {}\nReturn Path: {}\nContent-Type: {}\nDate: {}",
parse_content.headers.get_first_value("Subject").unwrap().as_str(),
parse_content.headers.get_first_value("From").unwrap().as_str(),
parse_content.headers.get_first_value("To").unwrap().as_str(),
parse_content.headers.get_first_value("Return-Path").unwrap().as_str(),
parse_content.headers.get_first_value("Content-Type").unwrap().as_str(),
parse_content.headers.get_first_value("Date").unwrap().as_str());
parse_content.headers.get_first_value("Subject").unwrap_or("N/A".to_string()).as_str(),
parse_content.headers.get_first_value("From").unwrap_or("N/A".to_string()).as_str(),
parse_content.headers.get_first_value("To").unwrap_or("N/A".to_string()).as_str(),
parse_content.headers.get_first_value("Return-Path").unwrap_or("N/A".to_string()).as_str(),
parse_content.headers.get_first_value("Content-Type").unwrap_or("N/A".to_string()).as_str(),
parse_content.headers.get_first_value("Date").unwrap_or("N/A".to_string()).as_str());

return parsed_content;
}
Expand Down

0 comments on commit 3241519

Please sign in to comment.