Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2025-03-12 16:47:03 +01:00
Correction of string read
Dieser Commit ist enthalten in:
Ursprung
30d90015d7
Commit
2d58f0a8a6
4 geänderte Dateien mit 10 neuen und 17 gelöschten Zeilen
|
@ -4,8 +4,8 @@ workspace = { members = ["macros"] }
|
|||
name = "vaultwarden"
|
||||
version = "1.0.0"
|
||||
authors = ["Daniel García <dani-garcia@users.noreply.github.com>"]
|
||||
edition = "2021"
|
||||
rust-version = "1.83.0"
|
||||
edition = "2024"
|
||||
rust-version = "1.85.0"
|
||||
resolver = "2"
|
||||
|
||||
repository = "https://github.com/dani-garcia/vaultwarden"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[toolchain]
|
||||
channel = "1.84.1"
|
||||
channel = "1.85"
|
||||
components = [ "rustfmt", "clippy" ]
|
||||
profile = "minimal"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
edition = "2021"
|
||||
edition = "2024"
|
||||
max_width = 120
|
||||
newline_style = "Unix"
|
||||
use_small_heuristics = "Off"
|
||||
|
|
17
src/mail.rs
17
src/mail.rs
|
@ -10,7 +10,7 @@ use lettre::{
|
|||
Address, AsyncSendmailTransport, AsyncSmtpTransport, AsyncTransport, Tokio1Executor,
|
||||
};
|
||||
use percent_encoding::{percent_encode, NON_ALPHANUMERIC};
|
||||
use std::{env::consts::EXE_SUFFIX, io::Read, str::FromStr};
|
||||
use std::{env::consts::EXE_SUFFIX, fs, str::FromStr};
|
||||
|
||||
use crate::{
|
||||
api::EmptyResult,
|
||||
|
@ -650,14 +650,12 @@ async fn send_email(address: &str, subject: &str, body_html: String, body_text:
|
|||
Some(true) => DkimSigningAlgorithm::Rsa,
|
||||
_ => DkimSigningAlgorithm::Ed25519,
|
||||
};
|
||||
let mut key = String::with_capacity(4096);
|
||||
let sig = match std::fs::File::open(sig) {
|
||||
Ok(mut f) => {
|
||||
if let Err(e) = f.read_to_string(&mut key) {
|
||||
let sig = match fs::read_to_string(sig) {
|
||||
Err(e) => {
|
||||
debug!("Cannot read DKIM file. Err is {:?}", e);
|
||||
None
|
||||
} else {
|
||||
key.shrink_to_fit();
|
||||
},
|
||||
Ok(key) => {
|
||||
match DkimSigningKey::new(&key, algo) {
|
||||
Ok(d) => Some(d),
|
||||
Err(e) => {
|
||||
|
@ -666,11 +664,6 @@ async fn send_email(address: &str, subject: &str, body_html: String, body_text:
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
debug!("Cannot read DKIM file. Err is {:?}", e);
|
||||
None
|
||||
}
|
||||
};
|
||||
match (sig, infos.split(':').collect::<Vec<&str>>()) {
|
||||
(Some(sig), split2) if split2.len() == 2 => {
|
||||
|
|
Laden …
Tabelle hinzufügen
In neuem Issue referenzieren