commit f9ebb780f92c44b63b1cab6be79ff120f183fc4c
parent 1fc6c30652b59a9dd7495393075df2a22246fa02
Author: Daniel GarcĂa <dani-garcia@users.noreply.github.com>
Date: Mon, 22 Mar 2021 20:00:57 +0100
Update dependencies
Diffstat:
M | Cargo.lock | | | 155 | ++++++++++++++++++++++++++++++++++++++++--------------------------------------- |
M | Cargo.toml | | | 10 | +++++----- |
M | src/mail.rs | | | 28 | +++++++++++++--------------- |
3 files changed, 96 insertions(+), 97 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
@@ -158,7 +158,7 @@ dependencies = [
"serde",
"serde_json",
"syslog",
- "time 0.2.25",
+ "time 0.2.26",
"u2f",
"uuid",
"yubico",
@@ -315,8 +315,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951"
dependencies = [
"percent-encoding 2.1.0",
- "time 0.2.25",
- "version_check 0.9.2",
+ "time 0.2.26",
+ "version_check 0.9.3",
]
[[package]]
@@ -401,7 +401,7 @@ dependencies = [
"bitflags",
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -429,7 +429,7 @@ checksum = "45f5098f628d02a7a0f68ddba586fb61e80edec3bdc1be3b921f4ceec60858d3"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -651,7 +651,7 @@ dependencies = [
"proc-macro-hack",
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -712,7 +712,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
dependencies = [
"typenum",
- "version_check 0.9.2",
+ "version_check 0.9.3",
]
[[package]]
@@ -841,7 +841,7 @@ dependencies = [
"markup5ever",
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -857,12 +857,13 @@ dependencies = [
[[package]]
name = "http-body"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994"
+checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737"
dependencies = [
"bytes 1.0.1",
"http",
+ "pin-project-lite",
]
[[package]]
@@ -1026,9 +1027,9 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
[[package]]
name = "js-sys"
-version = "0.3.48"
+version = "0.3.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dc9f84f9b115ce7843d60706df1422a916680bfdfcbdb0447c5614ff9d7e4d78"
+checksum = "dc15e39392125075f60c95ba416f5381ff6c3a948ff02ab12464715adf56c821"
dependencies = [
"wasm-bindgen",
]
@@ -1077,9 +1078,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "lettre"
-version = "0.10.0-beta.2"
+version = "0.10.0-beta.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a8dcca2a7f2c772f90dd58c3293ff4ac416486a7f0f4339a0d6775363e6bd12a"
+checksum = "897171ed0e63da84c988b157106ad8b6532d7499aeeec906ce46b05415cc79d3"
dependencies = [
"base64 0.13.0",
"hostname",
@@ -1099,9 +1100,9 @@ dependencies = [
[[package]]
name = "libc"
-version = "0.2.88"
+version = "0.2.90"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03b07a082330a35e43f63177cc01689da34fbffa0105e1246cf0311472cac73a"
+checksum = "ba4aede83fc3617411dc6993bc8c70919750c1c257c6ca6a502aed6e0e2394ae"
[[package]]
name = "libsqlite3-sys"
@@ -1224,7 +1225,7 @@ dependencies = [
"migrations_internals",
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -1283,9 +1284,9 @@ dependencies = [
[[package]]
name = "mio"
-version = "0.7.9"
+version = "0.7.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a5dede4e2065b3842b8b0af444119f3aa331cc7cc2dd20388bfb0f5d5a38823a"
+checksum = "2182a122f3b7f3f5329cb1972cee089ba2459a0a80a56935e6e674f096f8d839"
dependencies = [
"libc",
"log 0.4.14",
@@ -1412,7 +1413,7 @@ dependencies = [
"bitvec",
"funty",
"memchr",
- "version_check 0.9.2",
+ "version_check 0.9.3",
]
[[package]]
@@ -1443,7 +1444,7 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -1514,15 +1515,15 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
[[package]]
name = "openssl"
-version = "0.10.32"
+version = "0.10.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "038d43985d1ddca7a9900630d8cd031b56e4794eecc2e9ea39dd17aa04399a70"
+checksum = "a61075b62a23fef5a29815de7536d940aa35ce96d18ce0cc5076272db678a577"
dependencies = [
"bitflags",
"cfg-if 1.0.0",
"foreign-types",
- "lazy_static",
"libc",
+ "once_cell",
"openssl-sys",
]
@@ -1543,9 +1544,9 @@ dependencies = [
[[package]]
name = "openssl-sys"
-version = "0.9.60"
+version = "0.9.61"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "921fc71883267538946025deffb622905ecad223c28efbfdef9bb59a0175f3e6"
+checksum = "313752393519e876837e09e1fa183ddef0be7735868dced3196f4472d536277f"
dependencies = [
"autocfg",
"cc",
@@ -1640,9 +1641,9 @@ dependencies = [
[[package]]
name = "paste"
-version = "1.0.4"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c5d65c4d95931acda4498f675e332fcbdc9a06705cd07086c510e9b6009cd1c1"
+checksum = "acbf547ad0c65e31259204bd90935776d1c693cec2f4ff7abb7a1bbbd40dfe58"
[[package]]
name = "pear"
@@ -1662,7 +1663,7 @@ dependencies = [
"proc-macro2 0.4.30",
"quote 0.6.13",
"syn 0.15.44",
- "version_check 0.9.2",
+ "version_check 0.9.3",
"yansi",
]
@@ -1718,7 +1719,7 @@ dependencies = [
"pest_meta",
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -1793,7 +1794,7 @@ checksum = "758669ae3558c6f74bd2a18b41f7ac0b5a195aea6639d6a9b5e5d1ad5ba24c0b"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -2057,9 +2058,9 @@ dependencies = [
[[package]]
name = "regex"
-version = "1.4.4"
+version = "1.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54fd1046a3107eb58f42de31d656fee6853e5d276c455fd943742dce89fc3dd3"
+checksum = "957056ecddbeba1b26965114e191d2e8589ce74db242b6ea25fc4062427a5c19"
dependencies = [
"aho-corasick",
"memchr",
@@ -2165,9 +2166,9 @@ dependencies = [
"rocket_codegen",
"rocket_http",
"state",
- "time 0.2.25",
+ "time 0.2.26",
"toml",
- "version_check 0.9.2",
+ "version_check 0.9.3",
"yansi",
]
@@ -2181,7 +2182,7 @@ dependencies = [
"indexmap",
"quote 1.0.9",
"rocket_http",
- "version_check 0.9.2",
+ "version_check 0.9.3",
"yansi",
]
@@ -2210,7 +2211,7 @@ dependencies = [
"rustls",
"smallvec 1.6.1",
"state",
- "time 0.2.25",
+ "time 0.2.26",
"unicode-xid 0.2.1",
]
@@ -2359,7 +2360,7 @@ checksum = "1800f7693e94e186f5e25a28291ae1570da908aff7d97a095dec1e56ff99069b"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -2455,9 +2456,9 @@ dependencies = [
[[package]]
name = "siphasher"
-version = "0.3.3"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fa8f3741c7372e75519bd9346068370c9cdaabcc1f9599cbcf2a2719352286b7"
+checksum = "cbce6d4507c7e4a3962091436e56e95290cb71fa302d0d270e32130b75fbff27"
[[package]]
name = "slab"
@@ -2505,11 +2506,11 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "standback"
-version = "0.2.15"
+version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2beb4d1860a61f571530b3f855a1b538d0200f7871c63331ecd6f17b1f014f8"
+checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff"
dependencies = [
- "version_check 0.9.2",
+ "version_check 0.9.3",
]
[[package]]
@@ -2542,7 +2543,7 @@ dependencies = [
"quote 1.0.9",
"serde",
"serde_derive",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -2558,7 +2559,7 @@ dependencies = [
"serde_derive",
"serde_json",
"sha1",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -2611,9 +2612,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "1.0.63"
+version = "1.0.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8fd9bc7ccc2688b3344c2f48b9b546648b25ce0b20fc717ee7fa7981a8ca9717"
+checksum = "3fd9d1e9976102a03c542daa2eff1b43f9d72306342f3f8b3ed5fb8908195d6f"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.9",
@@ -2685,16 +2686,16 @@ dependencies = [
[[package]]
name = "time"
-version = "0.2.25"
+version = "0.2.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1195b046942c221454c2539395f85413b33383a067449d78aab2b7b052a142f7"
+checksum = "08a8cbfbf47955132d0202d1662f49b2423ae35862aee471f3ba4b133358f372"
dependencies = [
"const_fn",
"libc",
"standback",
"stdweb",
"time-macros",
- "version_check 0.9.2",
+ "version_check 0.9.3",
"winapi 0.3.9",
]
@@ -2718,7 +2719,7 @@ dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.9",
"standback",
- "syn 1.0.63",
+ "syn 1.0.64",
]
[[package]]
@@ -2738,15 +2739,15 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
[[package]]
name = "tokio"
-version = "1.3.0"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8d56477f6ed99e10225f38f9f75f872f29b8b8bd8c0b946f63345bb144e9eeda"
+checksum = "134af885d758d645f0f0505c9a8b3f9bf8a348fd822e112ab5248138348f1722"
dependencies = [
"autocfg",
"bytes 1.0.1",
"libc",
"memchr",
- "mio 0.7.9",
+ "mio 0.7.10",
"num_cpus",
"pin-project-lite",
]
@@ -2763,9 +2764,9 @@ dependencies = [
[[package]]
name = "tokio-util"
-version = "0.6.4"
+version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec31e5cc6b46e653cf57762f36f71d5e6386391d88a72fd6db4508f8f676fb29"
+checksum = "5143d049e85af7fbc36f5454d990e62c2df705b3589f123b71f441b6b59f443f"
dependencies = [
"bytes 1.0.1",
"futures-core",
@@ -2881,7 +2882,7 @@ version = "2.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
dependencies = [
- "version_check 0.9.2",
+ "version_check 0.9.3",
]
[[package]]
@@ -2972,15 +2973,15 @@ checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
[[package]]
name = "version_check"
-version = "0.9.2"
+version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed"
+checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
[[package]]
name = "walkdir"
-version = "2.3.1"
+version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
+checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
dependencies = [
"same-file",
"winapi 0.3.9",
@@ -3011,9 +3012,9 @@ checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
[[package]]
name = "wasm-bindgen"
-version = "0.2.71"
+version = "0.2.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ee1280240b7c461d6a0071313e08f34a60b0365f14260362e5a2b17d1d31aa7"
+checksum = "8fe8f61dba8e5d645a4d8132dc7a0a66861ed5e1045d2c0ed940fab33bac0fbe"
dependencies = [
"cfg-if 1.0.0",
"serde",
@@ -3023,24 +3024,24 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.71"
+version = "0.2.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b7d8b6942b8bb3a9b0e73fc79b98095a27de6fa247615e59d096754a3bc2aa8"
+checksum = "046ceba58ff062da072c7cb4ba5b22a37f00a302483f7e2a6cdc18fedbdc1fd3"
dependencies = [
"bumpalo",
"lazy_static",
"log 0.4.14",
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-futures"
-version = "0.4.21"
+version = "0.4.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8e67a5806118af01f0d9045915676b22aaebecf4178ae7021bc171dab0b897ab"
+checksum = "73157efb9af26fb564bb59a009afd1c7c334a44db171d280690d0c3faaec3468"
dependencies = [
"cfg-if 1.0.0",
"js-sys",
@@ -3050,9 +3051,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.71"
+version = "0.2.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5ac38da8ef716661f0f36c0d8320b89028efe10c7c0afde65baffb496ce0d3b"
+checksum = "0ef9aa01d36cda046f797c57959ff5f3c615c9cc63997a8d545831ec7976819b"
dependencies = [
"quote 1.0.9",
"wasm-bindgen-macro-support",
@@ -3060,28 +3061,28 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.71"
+version = "0.2.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cc053ec74d454df287b9374ee8abb36ffd5acb95ba87da3ba5b7d3fe20eb401e"
+checksum = "96eb45c1b2ee33545a813a92dbb53856418bf7eb54ab34f7f7ff1448a5b3735d"
dependencies = [
"proc-macro2 1.0.24",
"quote 1.0.9",
- "syn 1.0.63",
+ "syn 1.0.64",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.71"
+version = "0.2.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7d6f8ec44822dd71f5f221a5847fb34acd9060535c1211b70a05844c0f6383b1"
+checksum = "b7148f4696fb4960a346eaa60bbfb42a1ac4ebba21f750f75fc1375b098d5ffa"
[[package]]
name = "web-sys"
-version = "0.3.48"
+version = "0.3.49"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec600b26223b2948cedfde2a0aa6756dcf1fef616f43d7b3097aaf53a6c4d92b"
+checksum = "59fe19d70f5dacc03f6e46777213facae5ac3801575d56ca6cbd4c93dcd12310"
dependencies = [
"js-sys",
"wasm-bindgen",
diff --git a/Cargo.toml b/Cargo.toml
@@ -71,7 +71,7 @@ uuid = { version = "0.8.2", features = ["v4"] }
# Date and time libraries
chrono = { version = "0.4.19", features = ["serde"] }
chrono-tz = "0.5.3"
-time = "0.2.25"
+time = "0.2.26"
# TOTP library
oath = "0.10.2"
@@ -99,7 +99,7 @@ num-traits = "0.2.14"
num-derive = "0.3.3"
# Email libraries
-lettre = { version = "0.10.0-beta.2", features = ["smtp-transport", "builder", "serde", "native-tls", "hostname", "tracing"], default-features = false }
+lettre = { version = "0.10.0-beta.3", features = ["smtp-transport", "builder", "serde", "native-tls", "hostname", "tracing"], default-features = false }
newline-converter = "0.2.0"
# Template library
@@ -108,11 +108,11 @@ handlebars = { version = "3.5.3", features = ["dir_source"] }
# For favicon extraction from main website
html5ever = "0.25.1"
markup5ever_rcdom = "0.1.0"
-regex = { version = "1.4.4", features = ["std", "perf"], default-features = false }
+regex = { version = "1.4.5", features = ["std", "perf"], default-features = false }
data-url = "0.1.0"
# Used by U2F, JWT and Postgres
-openssl = "0.10.32"
+openssl = "0.10.33"
# URL encoding library
percent-encoding = "2.1.0"
@@ -126,7 +126,7 @@ pico-args = "0.4.0"
backtrace = "0.3.56"
# Macro ident concatenation
-paste = "1.0.4"
+paste = "1.0.5"
[patch.crates-io]
# Use newest ring
diff --git a/src/mail.rs b/src/mail.rs
@@ -332,21 +332,19 @@ fn send_email(address: &str, subject: &str, body_html: String, body_text: String
match mailer().send(&email) {
Ok(_) => Ok(()),
// Match some common errors and make them more user friendly
- Err(e) => match e {
- lettre::transport::smtp::Error::Client(x) => {
- err!(format!("SMTP Client error: {}", x));
- },
- lettre::transport::smtp::Error::Transient(x) => {
- err!(format!("SMTP 4xx error: {:?}", x.message));
- },
- lettre::transport::smtp::Error::Permanent(x) => {
- err!(format!("SMTP 5xx error: {:?}", x.message));
- },
- lettre::transport::smtp::Error::Io(x) => {
- err!(format!("SMTP IO error: {}", x));
- },
- // Fallback for all other errors
- _ => Err(e.into())
+ Err(e) => {
+
+ if e.is_client() {
+ err!(format!("SMTP Client error: {}", e));
+ } else if e.is_transient() {
+ err!(format!("SMTP 4xx error: {:?}", e));
+ } else if e.is_permanent() {
+ err!(format!("SMTP 5xx error: {:?}", e));
+ } else if e.is_timeout() {
+ err!(format!("SMTP timeout error: {:?}", e));
+ } else {
+ Err(e.into())
+ }
}
}
}