-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
99 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "mail-send" | ||
description = "E-mail delivery library with SMTP and DKIM support" | ||
version = "0.4.4" | ||
version = "0.4.5" | ||
edition = "2021" | ||
authors = [ "Stalwart Labs <[email protected]>"] | ||
license = "Apache-2.0 OR MIT" | ||
|
@@ -34,7 +34,6 @@ env_logger = "0.10.0" | |
|
||
[features] | ||
default = ["digest-md5", "cram-md5", "builder", "dkim"] | ||
skip-ehlo = [] | ||
builder = ["mail-builder"] | ||
dkim = ["mail-auth"] | ||
digest-md5 = ["md5", "rand"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -233,6 +233,27 @@ mod test { | |
|
||
#[tokio::test] | ||
async fn transparency_procedure() { | ||
const SMUGGLER: &str = r#"From: Joe SixPack <[email protected]> | ||
To: Suzie Q <[email protected]> | ||
Subject: Is dinner ready? | ||
Hi. | ||
We lost the game. Are you hungry yet? | ||
Joe. | ||
<SEP>. | ||
MAIL FROM:<[email protected]> | ||
RCPT TO:<[email protected]> | ||
DATA | ||
From: Joe SixPack <[email protected]> | ||
To: Suzie Q <[email protected]> | ||
Subject: smuggled message | ||
This is a smuggled message | ||
"#; | ||
|
||
for (test, result) in [ | ||
( | ||
"A: b\r\n.\r\n".to_string(), | ||
|
@@ -244,6 +265,36 @@ mod test { | |
"A: b\r\n...\r\n\r\n.\r\n".to_string(), | ||
), | ||
("A: ...b".to_string(), "A: ...b\r\n.\r\n".to_string()), | ||
( | ||
"A: \n.\r\nMAIL FROM:<>".to_string(), | ||
"A: \n..\r\nMAIL FROM:<>\r\n.\r\n".to_string(), | ||
), | ||
( | ||
"A: \r.\r\nMAIL FROM:<>".to_string(), | ||
"A: \r..\r\nMAIL FROM:<>\r\n.\r\n".to_string(), | ||
), | ||
( | ||
SMUGGLER | ||
.replace('\r', "") | ||
.replace('\n', "\r\n") | ||
.replace("<SEP>", "\r"), | ||
SMUGGLER | ||
.replace('\r', "") | ||
.replace('\n', "\r\n") | ||
.replace("<SEP>", "\r.") | ||
+ "\r\n.\r\n", | ||
), | ||
( | ||
SMUGGLER | ||
.replace('\r', "") | ||
.replace('\n', "\r\n") | ||
.replace("<SEP>", "\n"), | ||
SMUGGLER | ||
.replace('\r', "") | ||
.replace('\n', "\r\n") | ||
.replace("<SEP>", "\n.") | ||
+ "\r\n.\r\n", | ||
), | ||
] { | ||
let mut client = SmtpClient { | ||
stream: AsyncBufWriter::default(), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters