Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c40af78809 | ||
|
|
6d2e0d5046 | ||
|
|
c64cb0ff2e | ||
|
|
10d7b197ed | ||
|
|
fb54855d5f | ||
|
|
157c4fb5ae | ||
|
|
1196e332ee | ||
|
|
75770f7bc6 | ||
|
|
76d0929c94 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -4,4 +4,3 @@
|
|||||||
lettre.sublime-*
|
lettre.sublime-*
|
||||||
lettre.iml
|
lettre.iml
|
||||||
target/
|
target/
|
||||||
/Cargo.lock
|
|
||||||
|
|||||||
25
CHANGELOG.md
25
CHANGELOG.md
@@ -1,3 +1,26 @@
|
|||||||
|
<a name="v0.11.5"></a>
|
||||||
|
### v0.11.5 (2024-03-25)
|
||||||
|
|
||||||
|
#### Features
|
||||||
|
|
||||||
|
* Support SMTP SASL draft login challenge ([#911])
|
||||||
|
* Add conversion from SMTP response code to integer ([#941])
|
||||||
|
|
||||||
|
#### Misc
|
||||||
|
|
||||||
|
* Upgrade `rustls` to v0.23 ([#950])
|
||||||
|
* Bump `base64` to v0.22 ([#945])
|
||||||
|
* Fix typos in documentation ([#943], [#944])
|
||||||
|
* Add `Cargo.lock` ([#942])
|
||||||
|
|
||||||
|
[#911]: https://github.com/lettre/lettre/pull/911
|
||||||
|
[#941]: https://github.com/lettre/lettre/pull/941
|
||||||
|
[#942]: https://github.com/lettre/lettre/pull/942
|
||||||
|
[#943]: https://github.com/lettre/lettre/pull/943
|
||||||
|
[#944]: https://github.com/lettre/lettre/pull/944
|
||||||
|
[#945]: https://github.com/lettre/lettre/pull/945
|
||||||
|
[#950]: https://github.com/lettre/lettre/pull/950
|
||||||
|
|
||||||
<a name="v0.11.4"></a>
|
<a name="v0.11.4"></a>
|
||||||
### v0.11.4 (2024-01-28)
|
### v0.11.4 (2024-01-28)
|
||||||
|
|
||||||
@@ -244,7 +267,7 @@ Several breaking changes were made between 0.9 and 0.10, but changes should be s
|
|||||||
* Update `hostname` to 0.3
|
* Update `hostname` to 0.3
|
||||||
* Update to `nom` 6
|
* Update to `nom` 6
|
||||||
* Replace `log` with `tracing`
|
* Replace `log` with `tracing`
|
||||||
* Move CI to Github Actions
|
* Move CI to GitHub Actions
|
||||||
* Use criterion for benchmarks
|
* Use criterion for benchmarks
|
||||||
|
|
||||||
<a name="v0.9.2"></a>
|
<a name="v0.9.2"></a>
|
||||||
|
|||||||
2661
Cargo.lock
generated
Normal file
2661
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
10
Cargo.toml
10
Cargo.toml
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lettre"
|
name = "lettre"
|
||||||
# remember to update html_root_url and README.md (Cargo.toml example and deps.rs badge)
|
# remember to update html_root_url and README.md (Cargo.toml example and deps.rs badge)
|
||||||
version = "0.11.4"
|
version = "0.11.5"
|
||||||
description = "Email client"
|
description = "Email client"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
homepage = "https://lettre.rs"
|
homepage = "https://lettre.rs"
|
||||||
@@ -28,7 +28,7 @@ httpdate = { version = "1", optional = true }
|
|||||||
mime = { version = "0.3.4", optional = true }
|
mime = { version = "0.3.4", optional = true }
|
||||||
fastrand = { version = "2.0", optional = true }
|
fastrand = { version = "2.0", optional = true }
|
||||||
quoted_printable = { version = "0.5", optional = true }
|
quoted_printable = { version = "0.5", optional = true }
|
||||||
base64 = { version = "0.21", optional = true }
|
base64 = { version = "0.22", optional = true }
|
||||||
email-encoding = { version = "0.2", optional = true }
|
email-encoding = { version = "0.2", optional = true }
|
||||||
|
|
||||||
# file transport
|
# file transport
|
||||||
@@ -45,7 +45,7 @@ percent-encoding = { version = "2.3", optional = true }
|
|||||||
|
|
||||||
## tls
|
## tls
|
||||||
native-tls = { version = "0.2.5", optional = true } # feature
|
native-tls = { version = "0.2.5", optional = true } # feature
|
||||||
rustls = { version = "0.22.1", optional = true }
|
rustls = { version = "0.23.3", default-features = false, features = ["ring", "logging", "std", "tls12"], optional = true }
|
||||||
rustls-pemfile = { version = "2", optional = true }
|
rustls-pemfile = { version = "2", optional = true }
|
||||||
rustls-native-certs = { version = "0.7", optional = true }
|
rustls-native-certs = { version = "0.7", optional = true }
|
||||||
webpki-roots = { version = "0.26", optional = true }
|
webpki-roots = { version = "0.26", optional = true }
|
||||||
@@ -59,12 +59,12 @@ async-trait = { version = "0.1", optional = true }
|
|||||||
## async-std
|
## async-std
|
||||||
async-std = { version = "1.8", optional = true }
|
async-std = { version = "1.8", optional = true }
|
||||||
#async-native-tls = { version = "0.3.3", optional = true }
|
#async-native-tls = { version = "0.3.3", optional = true }
|
||||||
futures-rustls = { version = "0.25", optional = true }
|
futures-rustls = { version = "0.26", default-features = false, features = ["logging", "tls12", "ring"], optional = true }
|
||||||
|
|
||||||
## tokio
|
## tokio
|
||||||
tokio1_crate = { package = "tokio", version = "1", optional = true }
|
tokio1_crate = { package = "tokio", version = "1", optional = true }
|
||||||
tokio1_native_tls_crate = { package = "tokio-native-tls", version = "0.3", optional = true }
|
tokio1_native_tls_crate = { package = "tokio-native-tls", version = "0.3", optional = true }
|
||||||
tokio1_rustls = { package = "tokio-rustls", version = "0.25", optional = true }
|
tokio1_rustls = { package = "tokio-rustls", version = "0.26", default-features = false, features = ["logging", "tls12", "ring"], optional = true }
|
||||||
tokio1_boring = { package = "tokio-boring", version = "4", optional = true }
|
tokio1_boring = { package = "tokio-boring", version = "4", optional = true }
|
||||||
|
|
||||||
## dkim
|
## dkim
|
||||||
|
|||||||
@@ -28,8 +28,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div align="center">
|
<div align="center">
|
||||||
<a href="https://deps.rs/crate/lettre/0.11.4">
|
<a href="https://deps.rs/crate/lettre/0.11.5">
|
||||||
<img src="https://deps.rs/crate/lettre/0.11.4/status.svg"
|
<img src="https://deps.rs/crate/lettre/0.11.5/status.svg"
|
||||||
alt="dependency status" />
|
alt="dependency status" />
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -109,7 +109,7 @@
|
|||||||
//! [mime 0.3]: https://docs.rs/mime/0.3
|
//! [mime 0.3]: https://docs.rs/mime/0.3
|
||||||
//! [DKIM]: https://datatracker.ietf.org/doc/html/rfc6376
|
//! [DKIM]: https://datatracker.ietf.org/doc/html/rfc6376
|
||||||
|
|
||||||
#![doc(html_root_url = "https://docs.rs/crate/lettre/0.11.4")]
|
#![doc(html_root_url = "https://docs.rs/crate/lettre/0.11.5")]
|
||||||
#![doc(html_favicon_url = "https://lettre.rs/favicon.ico")]
|
#![doc(html_favicon_url = "https://lettre.rs/favicon.ico")]
|
||||||
#![doc(html_logo_url = "https://avatars0.githubusercontent.com/u/15113230?v=4")]
|
#![doc(html_logo_url = "https://avatars0.githubusercontent.com/u/15113230?v=4")]
|
||||||
#![forbid(unsafe_code)]
|
#![forbid(unsafe_code)]
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
//! | [`smtp`] | SMTP | [`SmtpTransport`] | [`AsyncSmtpTransport`] | Uses the SMTP protocol to send emails to a relay server |
|
//! | [`smtp`] | SMTP | [`SmtpTransport`] | [`AsyncSmtpTransport`] | Uses the SMTP protocol to send emails to a relay server |
|
||||||
//! | [`sendmail`] | Sendmail | [`SendmailTransport`] | [`AsyncSendmailTransport`] | Uses the `sendmail` command to send emails |
|
//! | [`sendmail`] | Sendmail | [`SendmailTransport`] | [`AsyncSendmailTransport`] | Uses the `sendmail` command to send emails |
|
||||||
//! | [`file`] | File | [`FileTransport`] | [`AsyncFileTransport`] | Saves the email as an `.eml` file |
|
//! | [`file`] | File | [`FileTransport`] | [`AsyncFileTransport`] | Saves the email as an `.eml` file |
|
||||||
//! | [`stub`] | Debug | [`StubTransport`] | [`StubTransport`] | Drops the email - Useful for debugging |
|
//! | [`stub`] | Debug | [`StubTransport`] | [`AsyncStubTransport`] | Drops the email - Useful for debugging |
|
||||||
//!
|
//!
|
||||||
//! ## Building an email
|
//! ## Building an email
|
||||||
//!
|
//!
|
||||||
@@ -97,6 +97,7 @@
|
|||||||
//! [`FileTransport`]: crate::FileTransport
|
//! [`FileTransport`]: crate::FileTransport
|
||||||
//! [`AsyncFileTransport`]: crate::AsyncFileTransport
|
//! [`AsyncFileTransport`]: crate::AsyncFileTransport
|
||||||
//! [`StubTransport`]: crate::transport::stub::StubTransport
|
//! [`StubTransport`]: crate::transport::stub::StubTransport
|
||||||
|
//! [`AsyncStubTransport`]: crate::transport::stub::AsyncStubTransport
|
||||||
|
|
||||||
#[cfg(any(feature = "async-std1", feature = "tokio1"))]
|
#[cfg(any(feature = "async-std1", feature = "tokio1"))]
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
|
|||||||
@@ -98,11 +98,13 @@ impl Mechanism {
|
|||||||
let decoded_challenge = challenge
|
let decoded_challenge = challenge
|
||||||
.ok_or_else(|| error::client("This mechanism does expect a challenge"))?;
|
.ok_or_else(|| error::client("This mechanism does expect a challenge"))?;
|
||||||
|
|
||||||
if ["User Name", "Username:", "Username"].contains(&decoded_challenge) {
|
if ["User Name", "Username:", "Username", "User Name\0"]
|
||||||
|
.contains(&decoded_challenge)
|
||||||
|
{
|
||||||
return Ok(credentials.authentication_identity.clone());
|
return Ok(credentials.authentication_identity.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
if ["Password", "Password:"].contains(&decoded_challenge) {
|
if ["Password", "Password:", "Password\0"].contains(&decoded_challenge) {
|
||||||
return Ok(credentials.secret.clone());
|
return Ok(credentials.secret.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ impl AsyncSmtpConnection {
|
|||||||
/// If `tls_parameters` is `Some`, then the connection will use Implicit TLS (sometimes
|
/// If `tls_parameters` is `Some`, then the connection will use Implicit TLS (sometimes
|
||||||
/// referred to as `SMTPS`). See also [`AsyncSmtpConnection::starttls`].
|
/// referred to as `SMTPS`). See also [`AsyncSmtpConnection::starttls`].
|
||||||
///
|
///
|
||||||
/// If `local_addres` is `Some`, then the address provided shall be used to bind the
|
/// If `local_address` is `Some`, then the address provided shall be used to bind the
|
||||||
/// connection to a specific local address using [`tokio1_crate::net::TcpSocket::bind`].
|
/// connection to a specific local address using [`tokio1_crate::net::TcpSocket::bind`].
|
||||||
///
|
///
|
||||||
/// Sends EHLO and parses server information
|
/// Sends EHLO and parses server information
|
||||||
|
|||||||
@@ -132,6 +132,12 @@ impl Code {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl From<Code> for u16 {
|
||||||
|
fn from(code: Code) -> Self {
|
||||||
|
code.detail as u16 + 10 * code.category as u16 + 100 * code.severity as u16
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Contains an SMTP reply, with separated code and message
|
/// Contains an SMTP reply, with separated code and message
|
||||||
///
|
///
|
||||||
/// The text message is optional, only the code is mandatory
|
/// The text message is optional, only the code is mandatory
|
||||||
@@ -317,6 +323,17 @@ mod test {
|
|||||||
assert_eq!(code.to_string(), "421");
|
assert_eq!(code.to_string(), "421");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_code_to_u16() {
|
||||||
|
let code = Code {
|
||||||
|
severity: Severity::TransientNegativeCompletion,
|
||||||
|
category: Category::Connections,
|
||||||
|
detail: Detail::One,
|
||||||
|
};
|
||||||
|
let c: u16 = code.into();
|
||||||
|
assert_eq!(c, 421);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_response_from_str() {
|
fn test_response_from_str() {
|
||||||
let raw_response = "250-me\r\n250-8BITMIME\r\n250-SIZE 42\r\n250 AUTH PLAIN CRAM-MD5\r\n";
|
let raw_response = "250-me\r\n250-8BITMIME\r\n250-SIZE 42\r\n250 AUTH PLAIN CRAM-MD5\r\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user