mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
fix starttls
This commit is contained in:
@@ -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(())
|
||||||
|
|||||||
Reference in New Issue
Block a user