diff --git a/CHANGELOG.md b/CHANGELOG.md index d3556d32..21a6b4cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [0.3.7] - 2023-09-05 + +## Added +- Option to disable IMAP All Messages folder (#68). +- Option to allow unencrypted SMTP AUTH (#72) +- Support for `rcpt-domain` key in `rcpt.relay` SMTP rule evaluation. + +### Changed + +### Fixed +- SMTP strategy `Ipv6thenIpv4` returns only IPv6 addresses (#70) +- Invalid IMAP `FETCH` responses for non-UTF-8 messages (#70) +- Allow `STATUS` and `ACL` IMAP operations on virtual mailboxes. +- IMAP `SELECT QRESYNC` without specifying a UID causes panic (#67) +- Milter `DATA` command is sent after headers which causes ClamAV to hang. +- Sieve `redirect` of unmodified messages does not work. + ## [0.3.6] - 2023-08-29 ## Added diff --git a/Cargo.lock b/Cargo.lock index 7672fe2f..19dff0a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2237,7 +2237,7 @@ dependencies = [ [[package]] name = "imap" -version = "0.3.6" +version = "0.3.7" dependencies = [ "ahash 0.8.3", "dashmap", @@ -2402,7 +2402,7 @@ dependencies = [ [[package]] name = "jmap" -version = "0.3.6" +version = "0.3.7" dependencies = [ "aes", "aes-gcm", @@ -2746,7 +2746,7 @@ dependencies = [ [[package]] name = "mail-server" -version = "0.3.6" +version = "0.3.7" dependencies = [ "directory", "imap", @@ -4605,7 +4605,7 @@ checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "smtp" -version = "0.3.6" +version = "0.3.7" dependencies = [ "ahash 0.8.3", "blake3", @@ -4929,7 +4929,7 @@ dependencies = [ [[package]] name = "stalwart-cli" -version = "0.3.6" +version = "0.3.7" dependencies = [ "clap", "console", @@ -4951,7 +4951,7 @@ dependencies = [ [[package]] name = "stalwart-install" -version = "0.3.6" +version = "0.3.7" dependencies = [ "base64 0.21.3", "clap", @@ -5763,7 +5763,7 @@ checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" [[package]] name = "utils" -version = "0.3.6" +version = "0.3.7" dependencies = [ "ahash 0.8.3", "dashmap", diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 500a4854..4f819f0d 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stalwart Labs Ltd. "] license = "AGPL-3.0-only" repository = "https://github.com/stalwartlabs/cli" homepage = "https://github.com/stalwartlabs/cli" -version = "0.3.6" +version = "0.3.7" edition = "2021" readme = "README.md" resolver = "2" diff --git a/crates/imap/Cargo.toml b/crates/imap/Cargo.toml index cf28cd6a..c3eeb3b2 100644 --- a/crates/imap/Cargo.toml +++ b/crates/imap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "imap" -version = "0.3.6" +version = "0.3.7" edition = "2021" resolver = "2" diff --git a/crates/install/Cargo.toml b/crates/install/Cargo.toml index 3ab6c158..c23ad6f9 100644 --- a/crates/install/Cargo.toml +++ b/crates/install/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Stalwart Labs Ltd. "] license = "AGPL-3.0-only" repository = "https://github.com/stalwartlabs/mail-server" homepage = "https://github.com/stalwartlabs/mail-server" -version = "0.3.6" +version = "0.3.7" edition = "2021" readme = "README.md" resolver = "2" diff --git a/crates/jmap/Cargo.toml b/crates/jmap/Cargo.toml index 99d83464..893d42bf 100644 --- a/crates/jmap/Cargo.toml +++ b/crates/jmap/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jmap" -version = "0.3.6" +version = "0.3.7" edition = "2021" resolver = "2" diff --git a/crates/main/Cargo.toml b/crates/main/Cargo.toml index a59be055..f1eb2aaf 100644 --- a/crates/main/Cargo.toml +++ b/crates/main/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://stalw.art" keywords = ["imap", "jmap", "smtp", "email", "mail", "server"] categories = ["email"] license = "AGPL-3.0-only" -version = "0.3.6" +version = "0.3.7" edition = "2021" resolver = "2" diff --git a/crates/smtp/Cargo.toml b/crates/smtp/Cargo.toml index 7061e8cd..aedecca4 100644 --- a/crates/smtp/Cargo.toml +++ b/crates/smtp/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://stalw.art/smtp" keywords = ["smtp", "email", "mail", "server"] categories = ["email"] license = "AGPL-3.0-only" -version = "0.3.6" +version = "0.3.7" edition = "2021" resolver = "2" diff --git a/crates/smtp/src/config/mod.rs b/crates/smtp/src/config/mod.rs index 64a8e2aa..13c4b1fc 100644 --- a/crates/smtp/src/config/mod.rs +++ b/crates/smtp/src/config/mod.rs @@ -225,6 +225,7 @@ pub struct Auth { pub directory: IfBlock>>, pub mechanisms: IfBlock, pub require: IfBlock, + pub allow_plain_text: IfBlock, pub errors_max: IfBlock, pub errors_wait: IfBlock, } diff --git a/crates/smtp/src/config/session.rs b/crates/smtp/src/config/session.rs index 4e62b470..fad79705 100644 --- a/crates/smtp/src/config/session.rs +++ b/crates/smtp/src/config/session.rs @@ -284,6 +284,9 @@ impl ConfigSession for Config { errors_wait: self .parse_if_block("session.auth.errors.wait", ctx, &available_keys)? .unwrap_or_else(|| IfBlock::new(Duration::from_secs(30))), + allow_plain_text: self + .parse_if_block("session.auth.allow-plain-text", ctx, &available_keys)? + .unwrap_or_else(|| IfBlock::new(false)), }) } diff --git a/crates/smtp/src/core/mod.rs b/crates/smtp/src/core/mod.rs index 3572d474..1fae226f 100644 --- a/crates/smtp/src/core/mod.rs +++ b/crates/smtp/src/core/mod.rs @@ -225,6 +225,7 @@ pub struct SessionParameters { pub auth_require: bool, pub auth_errors_max: usize, pub auth_errors_wait: Duration, + pub auth_plain_text: bool, // Rcpt parameters pub rcpt_errors_max: usize, @@ -426,6 +427,7 @@ impl Session { auth_require: Default::default(), auth_errors_max: Default::default(), auth_errors_wait: Default::default(), + auth_plain_text: false, rcpt_errors_max: Default::default(), rcpt_errors_wait: Default::default(), rcpt_max: Default::default(), diff --git a/crates/smtp/src/core/params.rs b/crates/smtp/src/core/params.rs index 502beaa4..f9bc1918 100644 --- a/crates/smtp/src/core/params.rs +++ b/crates/smtp/src/core/params.rs @@ -48,6 +48,7 @@ impl Session { self.params.auth_require = *ac.require.eval(self).await; self.params.auth_errors_max = *ac.errors_max.eval(self).await; self.params.auth_errors_wait = *ac.errors_wait.eval(self).await; + self.params.auth_plain_text = *ac.allow_plain_text.eval(self).await; // VRFY/EXPN parameters let ec = &self.core.session.config.extensions; diff --git a/crates/smtp/src/inbound/ehlo.rs b/crates/smtp/src/inbound/ehlo.rs index 8e44fdf6..430a92d8 100644 --- a/crates/smtp/src/inbound/ehlo.rs +++ b/crates/smtp/src/inbound/ehlo.rs @@ -170,7 +170,7 @@ impl Session { if self.data.authenticated_as.is_empty() { response.auth_mechanisms = *ac.mechanisms.eval(self).await; if response.auth_mechanisms != 0 { - if !self.stream.is_tls() { + if !self.stream.is_tls() && !self.params.auth_plain_text { response.auth_mechanisms &= !(AUTH_PLAIN | AUTH_LOGIN); } if response.auth_mechanisms != 0 { diff --git a/crates/smtp/src/inbound/session.rs b/crates/smtp/src/inbound/session.rs index 967b3827..f21eee9e 100644 --- a/crates/smtp/src/inbound/session.rs +++ b/crates/smtp/src/inbound/session.rs @@ -103,6 +103,7 @@ impl Session { self.write(b"503 5.5.1 Already authenticated.\r\n").await?; } else if mechanism & (AUTH_LOGIN | AUTH_PLAIN) != 0 && !self.stream.is_tls() + && !self.params.auth_plain_text { self.write(b"503 5.5.1 Clear text authentication without TLS is forbidden.\r\n").await?; } else if let Some(mut token) = diff --git a/crates/utils/Cargo.toml b/crates/utils/Cargo.toml index 6d911830..b8058c61 100644 --- a/crates/utils/Cargo.toml +++ b/crates/utils/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "utils" -version = "0.3.6" +version = "0.3.7" edition = "2021" resolver = "2" diff --git a/tests/src/smtp/mod.rs b/tests/src/smtp/mod.rs index 36f759fb..0a1c4e49 100644 --- a/tests/src/smtp/mod.rs +++ b/tests/src/smtp/mod.rs @@ -236,6 +236,7 @@ impl TestConfig for SessionConfig { require: IfBlock::new(false), errors_max: IfBlock::new(10), errors_wait: IfBlock::new(Duration::from_secs(1)), + allow_plain_text: IfBlock::new(false), }, mail: Mail { script: IfBlock::new(None),