geforkt von mirrored/vaultwarden
Explicitly close SMTP connection in case of error.
Dieser Commit ist enthalten in:
Ursprung
04922f6aa0
Commit
9e1f030a80
1 geänderte Dateien mit 8 neuen und 2 gelöschten Zeilen
10
src/mail.rs
10
src/mail.rs
|
@ -137,8 +137,14 @@ fn send_email(address: &str, subject: &str, body_html: &str, body_text: &str) ->
|
||||||
.build()
|
.build()
|
||||||
.map_err(|e| Error::new("Error building email", e.to_string()))?;
|
.map_err(|e| Error::new("Error building email", e.to_string()))?;
|
||||||
|
|
||||||
mailer()
|
let mut transport = mailer();
|
||||||
|
|
||||||
|
let result = transport
|
||||||
.send(email.into())
|
.send(email.into())
|
||||||
.map_err(|e| Error::new("Error sending email", e.to_string()))
|
.map_err(|e| Error::new("Error sending email", e.to_string()))
|
||||||
.and(Ok(()))
|
.and(Ok(()));
|
||||||
|
|
||||||
|
// Explicitly close the connection, in case of error
|
||||||
|
transport.close();
|
||||||
|
result
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren