Compare commits

...

5 Commits

Author SHA1 Message Date
Alexis Mousset
d930c42d50 Prepare 0.9.5 release 2020-11-11 17:39:04 +01:00
Alexis Mousset
1c4a630833 Prepare 0.9.4 release 2020-11-11 17:32:30 +01:00
Alexis Mousset
1738c8e52d fix(transport-sendmail): Stop argument parsing before destination addresses 2020-11-11 17:28:02 +01:00
Alexis Mousset
2b9e476b17 Merge pull request #421 from Zoruk/v0.9.x-fix-attachment
Fix attachment line length
2020-05-06 11:07:22 +02:00
Loïc Haas
44852e42f2 Fix attachment line length 2020-05-06 10:50:36 +02:00
5 changed files with 18 additions and 3 deletions

View File

@@ -1,3 +1,11 @@
<a name="v0.9.5"></a>
### v0.9.5 (2020-11-11)
#### Bug Fixes
* **transport**
* **SECURITY**: Prevent argument injection in sendmail transport
<a name="v0.9.4"></a> <a name="v0.9.4"></a>
### v0.9.4 (2020-04-21) ### v0.9.4 (2020-04-21)

View File

@@ -1,7 +1,7 @@
[package] [package]
name = "lettre" name = "lettre"
version = "0.9.3" # remember to update html_root_url version = "0.9.5" # remember to update html_root_url
description = "Email client" description = "Email client"
readme = "README.md" readme = "README.md"
homepage = "http://lettre.at" homepage = "http://lettre.at"

View File

@@ -3,7 +3,7 @@
//! This mailer contains the available transports for your emails. //! This mailer contains the available transports for your emails.
//! //!
#![doc(html_root_url = "https://docs.rs/lettre/0.9.3")] #![doc(html_root_url = "https://docs.rs/lettre/0.9.5")]
#![deny( #![deny(
missing_copy_implementations, missing_copy_implementations,
trivial_casts, trivial_casts,

View File

@@ -50,6 +50,7 @@ impl<'a> Transport<'a> for SendmailTransport {
.map(|x| x.as_ref()) .map(|x| x.as_ref())
.unwrap_or("\"\""), .unwrap_or("\"\""),
) )
.arg("--")
.args(email.envelope.to()) .args(email.envelope.to())
.stdin(Stdio::piped()) .stdin(Stdio::piped())
.stdout(Stdio::piped()) .stdout(Stdio::piped())

View File

@@ -271,7 +271,13 @@ impl EmailBuilder {
filename: &str, filename: &str,
content_type: &Mime, content_type: &Mime,
) -> Result<EmailBuilder, Error> { ) -> Result<EmailBuilder, Error> {
let encoded_body = base64::encode(&body); let encoded_body = base64::encode(&body)
.as_bytes()
.chunks(72)
// base64 encoding is guaranteed to return utf-8, so this won't panic
.map(|s| std::str::from_utf8(s).unwrap())
.collect::<Vec<_>>()
.join("\r\n");
let content = PartBuilder::new() let content = PartBuilder::new()
.body(encoded_body) .body(encoded_body)
.header(( .header((