Fix wrong SMTP port when TLS is being used (fixes #3574) (#3607)

Co-authored-by: Manuel Bleichner <manuel.bleichner@bvu.de>
This commit is contained in:
Manuel Bleichner 2023-07-13 13:10:14 +02:00 committed by GitHub
parent 40ff77eee2
commit c0b7865896
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,12 +68,10 @@ pub async fn send_email(
// is bad. // is bad.
// Set the TLS // Set the TLS
let builder_dangerous = AsyncSmtpTransport::builder_dangerous(smtp_server).port(smtp_port);
let mut builder = match email_config.tls_type.as_str() { let mut builder = match email_config.tls_type.as_str() {
"starttls" => AsyncSmtpTransport::starttls_relay(smtp_server)?, "starttls" => AsyncSmtpTransport::starttls_relay(smtp_server)?.port(smtp_port),
"tls" => AsyncSmtpTransport::relay(smtp_server)?, "tls" => AsyncSmtpTransport::relay(smtp_server)?.port(smtp_port),
_ => builder_dangerous, _ => AsyncSmtpTransport::builder_dangerous(smtp_server).port(smtp_port),
}; };
// Set the creds if they exist // Set the creds if they exist