mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-11-19 03:35:11 +00:00
Explicitly close SMTP connection in case of error.
This commit is contained in:
parent
04922f6aa0
commit
9e1f030a80
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()
|
||||
.map_err(|e| Error::new("Error building email", e.to_string()))?;
|
||||
|
||||
mailer()
|
||||
let mut transport = mailer();
|
||||
|
||||
let result = transport
|
||||
.send(email.into())
|
||||
.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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user