Skip to content

Commit

Permalink
v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Jul 10, 2024
1 parent ae97759 commit c2b37e9
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 24 deletions.
13 changes: 0 additions & 13 deletions .github/FUNDING.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
mail-builder 0.3.2
================================
- Made `gethostname` crate optional.

mail-builder 0.3.1
================================
- Added `MimePart::transfer_encoding` method to disable automatic Content-Transfer-Encoding detection and treat it as a raw MIME part.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mail-builder"
description = "E-mail builder library for Rust"
version = "0.3.1"
version = "0.3.2"
edition = "2021"
authors = [ "Stalwart Labs <[email protected]>"]
license = "Apache-2.0 OR MIT"
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ _mail-builder_ is a flexible **e-mail builder library** written in Rust. It incl
- Generates **e-mail** messages conforming to the Internet Message Format standard (_RFC 5322_).
- Full **MIME** support (_RFC 2045 - 2049_) with automatic selection of the most optimal encoding for each message body part.
- **Fast Base64 encoding** based on Chromium's decoder ([the fastest non-SIMD encoder](https://github.com/lemire/fastbase64)).
- Minimal dependencies.
- The dependency on `gethostname` is optional.
- No dependencies (`gethostname` is optional).

Please note that this library does not support sending or parsing e-mail messages as these functionalities are provided by the crates [`mail-send`](https://crates.io/crates/mail-send) and [`mail-parser`](https://crates.io/crates/mail-parser).

Expand Down
1 change: 1 addition & 0 deletions src/encoders/base64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ pub fn base64_encode_mime(
}

#[cfg(test)]
#[allow(clippy::items_after_test_module)]
mod tests {

#[test]
Expand Down
11 changes: 3 additions & 8 deletions src/mime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,17 +104,12 @@ impl<'x> From<&'x String> for ContentType<'x> {
}
}

thread_local!(static COUNTER: Cell<u64> = Cell::new(0));
thread_local!(static COUNTER: Cell<u64> = const { Cell::new(0) });

pub fn make_boundary(separator: &str) -> String {
// Create a pseudo-unique boundary
let mut s = DefaultHasher::new();

#[cfg(feature = "gethostname")]
gethostname::gethostname().hash(&mut s);

#[cfg(not(feature = "gethostname"))]
"localhost".hash(&mut s);

((&s as *const DefaultHasher) as usize).hash(&mut s);
thread::current().id().hash(&mut s);
let hash = s.finish();

Expand Down

0 comments on commit c2b37e9

Please sign in to comment.