1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-06-25 08:45:41 +02:00

Explicitly close SMTP connection in case of error.

Dieser Commit ist enthalten in:
Daniel García 2019-03-07 20:21:10 +01:00
Ursprung 04922f6aa0
Commit 9e1f030a80
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: FC8A7D14C3CD543A

Datei anzeigen

@ -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
}