fix starttls

This commit is contained in:
Aiden McClelland
2026-03-05 09:44:05 -07:00
parent e71023a3a7
commit 5a0cd302de

View File

@@ -1238,19 +1238,13 @@ pub async fn test_smtp(
.body("This is a test email sent from your StartOS Server".to_owned())?; .body("This is a test email sent from your StartOS Server".to_owned())?;
let transport = match security { let transport = match security {
SmtpSecurity::Starttls => AsyncSmtpTransport::<Tokio1Executor>::relay(&host)? SmtpSecurity::Starttls => AsyncSmtpTransport::<Tokio1Executor>::starttls_relay(&host)?,
.port(port) SmtpSecurity::Tls => AsyncSmtpTransport::<Tokio1Executor>::relay(&host)?,
.credentials(creds) }
.build(), .port(port)
SmtpSecurity::Tls => { .tls(Tls::Wrapper(TlsParameters::new(host.clone())?))
let tls = TlsParameters::new(host.clone())?; .credentials(creds)
AsyncSmtpTransport::<Tokio1Executor>::relay(&host)? .build();
.port(port)
.tls(Tls::Wrapper(tls))
.credentials(creds)
.build()
}
};
transport.send(message).await?; transport.send(message).await?;
Ok(()) Ok(())