Spiegel von
https://github.com/dani-garcia/vaultwarden.git
synchronisiert 2024-11-29 06:20:29 +01:00
Allow the smtp mechanism to be provided without quotes and all lowercase
Dieser Commit ist enthalten in:
Ursprung
47a9461f39
Commit
afd9f4e278
1 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen
|
@ -44,10 +44,11 @@ fn mailer() -> SmtpTransport {
|
|||
_ => smtp_client,
|
||||
};
|
||||
|
||||
let smtp_client = match &CONFIG.smtp_auth_mechanism() {
|
||||
Some(auth_mechanism_json) => {
|
||||
let auth_mechanism = serde_json::from_str::<SmtpAuthMechanism>(&auth_mechanism_json);
|
||||
match auth_mechanism {
|
||||
let smtp_client = match CONFIG.smtp_auth_mechanism() {
|
||||
Some(mechanism) => {
|
||||
let correct_mechanism = format!("\"{}\"", crate::util::upcase_first(&mechanism.trim_matches('"')));
|
||||
|
||||
match serde_json::from_str::<SmtpAuthMechanism>(&correct_mechanism) {
|
||||
Ok(auth_mechanism) => smtp_client.authentication_mechanism(auth_mechanism),
|
||||
_ => panic!("Failure to parse mechanism. Is it proper Json? Eg. `\"Plain\"` not `Plain`"),
|
||||
}
|
||||
|
|
Laden …
In neuem Issue referenzieren