From 9877502f01f131a50834edde580256b8790a62d0 Mon Sep 17 00:00:00 2001 From: Oliver Ford Date: Mon, 29 Jan 2024 21:44:48 +0000 Subject: [PATCH] Bump lettre to non-pre-release version --- Cargo.lock | 320 +++++++++++++++++++++++------------ lambda-smtp-relay/Cargo.toml | 2 +- lambda-smtp-relay/handler.rs | 4 +- notmuch-more/Cargo.toml | 2 +- notmuch-more/src/error.rs | 2 +- notmuch-more/src/smtp.rs | 7 +- 6 files changed, 225 insertions(+), 112 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8bdb67b..0ffea6f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,7 +90,7 @@ dependencies = [ "serde_derive", "stderrlog", "tokio 0.2.25", - "webpki-roots", + "webpki-roots 0.19.0", ] [[package]] @@ -127,12 +127,6 @@ version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "async-trait" version = "0.1.64" @@ -342,12 +336,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bufstream" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40e38929add23cdf8a366df9b0e088953150724bcbe5fc330b0d8eb3b328eec8" - [[package]] name = "bumpalo" version = "3.12.0" @@ -783,7 +771,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d3686f5fa27dbc1d76c751300376e167c5a43387f44bb451fd1c24776e49113" dependencies = [ - "sct", + "sct 0.6.1", ] [[package]] @@ -1019,6 +1007,22 @@ dependencies = [ "version_check", ] +[[package]] +name = "email-encoding" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34dd14c63662e0206599796cd5e1ad0268ab2b9d19b868d6050d688eba2bbf98" +dependencies = [ + "base64 0.13.1", + "memchr", +] + +[[package]] +name = "email_address" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2153bd83ebc09db15bcbdc3e2194d901804952e3dc96967e1cd3b0c5c32d112" + [[package]] name = "embed_plist" version = "1.2.2" @@ -1136,6 +1140,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "fastrand" version = "2.0.1" @@ -1867,7 +1880,7 @@ dependencies = [ "httpdate 0.3.2", "itoa 0.4.8", "pin-project 1.0.12", - "socket2", + "socket2 0.3.19", "tokio 0.2.25", "tower-service", "tracing", @@ -1889,23 +1902,7 @@ dependencies = [ "rustls-native-certs", "tokio 0.2.25", "tokio-rustls", - "webpki", -] - -[[package]] -name = "hyperx" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5617e92fc2f2501c3e2bc6ce547cad841adba2bae5b921c7e52510beca6d084c" -dependencies = [ - "base64 0.13.1", - "bytes 1.1.0", - "http 0.2.8", - "httpdate 1.0.2", - "language-tags", - "mime", - "percent-encoding", - "unicase", + "webpki 0.21.4", ] [[package]] @@ -2205,12 +2202,6 @@ dependencies = [ "synstructure 0.10.2", ] -[[package]] -name = "language-tags" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4345964bb142484797b161f473a503a434de77149dd8c7427788c6e13379388" - [[package]] name = "lazy_static" version = "0.2.11" @@ -2225,38 +2216,24 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lettre" -version = "0.10.0-alpha.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deaf9b74d40fcb52d0f762eb08e45d5152b4db59d29bb73edd4cac7fe796862c" +checksum = "5677c78c7c7ede1dd68e8a7078012bc625449fb304e7b509b917eaaedfe6e849" dependencies = [ - "base64 0.12.3", - "bufstream", - "hyperx", + "base64 0.13.1", + "email-encoding", + "email_address", + "fastrand 1.9.0", + "httpdate 1.0.2", "idna", - "line-wrap", "mime", "nom", "once_cell", "quoted_printable 0.4.7", - "regex", - "rustls 0.17.0", - "textnonce", - "uuid 0.8.2", - "webpki", - "webpki-roots", -] - -[[package]] -name = "lexical-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" -dependencies = [ - "arrayvec", - "bitflags 1.3.2", - "cfg-if 1.0.0", - "ryu", - "static_assertions", + "rustls 0.20.9", + "rustls-pemfile", + "socket2 0.4.10", + "webpki-roots 0.22.6", ] [[package]] @@ -2456,6 +2433,12 @@ dependencies = [ "unicase", ] +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.6.2" @@ -2590,13 +2573,12 @@ checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" [[package]] name = "nom" -version = "5.1.3" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08959a387a676302eebf4ddbcbc611da04285579f76f88ee0506c63b1a61dd4b" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ - "lexical-core", "memchr", - "version_check", + "minimal-lexical", ] [[package]] @@ -3419,12 +3401,26 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi 0.3.9", ] +[[package]] +name = "ring" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom 0.2.12", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys 0.48.0", +] + [[package]] name = "rusoto_core" version = "0.43.0" @@ -3566,9 +3562,9 @@ checksum = "b25a18b1bf7387f0145e7f8324e700805aade3842dd3db2e74e4cdeb4677c09e" dependencies = [ "base64 0.10.1", "log", - "ring", - "sct", - "webpki", + "ring 0.16.20", + "sct 0.6.1", + "webpki 0.21.4", ] [[package]] @@ -3579,9 +3575,21 @@ checksum = "c0d4a31f5d68413404705d6982529b0e11a9aacd4839d1d6222ee3b8cb4015e1" dependencies = [ "base64 0.11.0", "log", - "ring", - "sct", - "webpki", + "ring 0.16.20", + "sct 0.6.1", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct 0.7.1", + "webpki 0.22.4", ] [[package]] @@ -3596,6 +3604,15 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + [[package]] name = "rustversion" version = "1.0.11" @@ -3656,8 +3673,18 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -3950,6 +3977,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi 0.3.9", +] + [[package]] name = "soup2" version = "0.2.1" @@ -3984,6 +4021,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -4008,12 +4051,6 @@ dependencies = [ "loom", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "stderrlog" version = "0.4.3" @@ -4451,7 +4488,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if 1.0.0", - "fastrand", + "fastrand 2.0.1", "redox_syscall 0.4.1", "rustix", "windows-sys 0.52.0", @@ -4489,19 +4526,6 @@ dependencies = [ "redox_termios", ] -[[package]] -name = "textnonce" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc659075a12c12c07bbb384862c352506707f6597f5b495f65427d08519b617" -dependencies = [ - "base64 0.12.3", - "byteorder", - "chrono", - "rand 0.7.3", - "serde", -] - [[package]] name = "textwrap" version = "0.16.0" @@ -4813,7 +4837,7 @@ dependencies = [ "futures-core", "rustls 0.17.0", "tokio 0.2.25", - "webpki", + "webpki 0.21.4", ] [[package]] @@ -5127,6 +5151,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.3.0" @@ -5150,9 +5180,6 @@ name = "uuid" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" -dependencies = [ - "getrandom 0.2.12", -] [[package]] name = "uuid" @@ -5372,8 +5399,18 @@ version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] @@ -5382,7 +5419,16 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8eff4b7516a57307f9349c64bf34caa34b940b66fed4b2fb3136cb7386e5739" dependencies = [ - "webpki", + "webpki 0.21.4", +] + +[[package]] +name = "webpki-roots" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +dependencies = [ + "webpki 0.22.4", ] [[package]] @@ -5553,6 +5599,15 @@ dependencies = [ "windows-targets 0.42.1", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + [[package]] name = "windows-sys" version = "0.52.0" @@ -5577,6 +5632,21 @@ dependencies = [ "windows_x86_64_msvc 0.42.1", ] +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + [[package]] name = "windows-targets" version = "0.52.0" @@ -5604,6 +5674,12 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_gnullvm" version = "0.52.0" @@ -5628,6 +5704,12 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_aarch64_msvc" version = "0.52.0" @@ -5652,6 +5734,12 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_gnu" version = "0.52.0" @@ -5676,6 +5764,12 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_i686_msvc" version = "0.52.0" @@ -5700,6 +5794,12 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnu" version = "0.52.0" @@ -5712,6 +5812,12 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_gnullvm" version = "0.52.0" @@ -5736,6 +5842,12 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "windows_x86_64_msvc" version = "0.52.0" diff --git a/lambda-smtp-relay/Cargo.toml b/lambda-smtp-relay/Cargo.toml index 9f5b6f7..25f998f 100644 --- a/lambda-smtp-relay/Cargo.toml +++ b/lambda-smtp-relay/Cargo.toml @@ -18,7 +18,7 @@ path = "./handler.rs" aws_lambda_events = "^0.2" futures = "^0.3" lambda_runtime = "^0.2" -lettre = {version = "=0.10.0-alpha.1", default_features = false, features=["builder", "rustls-tls", "smtp-transport"]} +lettre = {version = "=0.10.0", default_features = false, features=["builder", "rustls-tls", "smtp-transport"]} log = "^0.4" rusoto_core = {version = "^0.43.0-beta.1", default_features = false, features=["rustls"]} rusoto_s3 = {version = "^0.43.0-beta.1", default_features = false, features=["rustls"]} diff --git a/lambda-smtp-relay/handler.rs b/lambda-smtp-relay/handler.rs index 7bf1b1e..1caa82b 100644 --- a/lambda-smtp-relay/handler.rs +++ b/lambda-smtp-relay/handler.rs @@ -89,8 +89,8 @@ async fn relay_eml(smtp: &mut smtp::SmtpTransport, s3: &S3Client, message_id: &s ) .expect("Malformed $RELAY_ENVELOPE_FROM"); - let envelope = - lettre::Envelope::new(Some(relay_from), vec![relay_to]).expect("Failed to build envelope"); + let envelope = lettre::address::Envelope::new(Some(relay_from), vec![relay_to]) + .expect("Failed to build envelope"); smtp.send_raw(&envelope, &content) .unwrap_or_else(|_| panic!("Failed to send {message_id}")); diff --git a/notmuch-more/Cargo.toml b/notmuch-more/Cargo.toml index 5762bba..1522792 100644 --- a/notmuch-more/Cargo.toml +++ b/notmuch-more/Cargo.toml @@ -15,7 +15,7 @@ chrono = "^0.4.33" delegate = "^0.12.0" email = "^0.0.21" itertools = "^0.12.0" -lettre = {version = "=0.10.0-alpha.1", default_features = false, features= ["builder", "rustls-tls", "smtp-transport"] } +lettre = {version = "=0.10.0", default_features = false, features= ["builder", "rustls-tls", "smtp-transport"] } mailparse = "^0.14.1" mime_guess = "^2.0.4" notmuch = "^0.6.0" diff --git a/notmuch-more/src/error.rs b/notmuch-more/src/error.rs index 1e4c5d4..0f4b8db 100644 --- a/notmuch-more/src/error.rs +++ b/notmuch-more/src/error.rs @@ -14,7 +14,7 @@ pub enum NotmuchMoreError { #[error(transparent)] LettreError(#[from] lettre::error::Error), #[error(transparent)] - LettreSmtpError(#[from] lettre::transport::smtp::error::Error), + LettreSmtpError(#[from] lettre::transport::smtp::Error), #[error(transparent)] NotMuchError(#[from] notmuch::Error), #[error(transparent)] diff --git a/notmuch-more/src/smtp.rs b/notmuch-more/src/smtp.rs index f36aa64..ac5f14d 100644 --- a/notmuch-more/src/smtp.rs +++ b/notmuch-more/src/smtp.rs @@ -2,6 +2,7 @@ use std::io::Write; use std::str::FromStr; use anyhow::anyhow; +use itertools::Itertools; use lettre::transport::smtp; use lettre::Transport; use notmuch::Database; @@ -31,7 +32,7 @@ impl Smtp { from: String, eml: String, ) -> Result<(), NotmuchMoreError> { - let envelope = lettre::Envelope::new( + let envelope = lettre::address::Envelope::new( Some(lettre::Address::from_str(&from)?), to.iter() .map(|e| lettre::Address::from_str(e)) @@ -82,8 +83,8 @@ impl Smtp { } false => Err(anyhow!( "SMTP error {}: {}", - response.code, - response.message.join("\n") + response.code(), + response.message().join("\n") ) .into()), }