Skip to content
This repository was archived by the owner on Sep 10, 2024. It is now read-only.

Commit 6a5d486

Browse files
committed
Revert "Skip certificate chain validation when sending emails"
This reverts commit af4f19d.
1 parent 854badb commit 6a5d486

File tree

1 file changed

+2
-24
lines changed

1 file changed

+2
-24
lines changed

crates/email/src/transport.rs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -75,30 +75,8 @@ impl Transport {
7575
) -> Result<Self, lettre::transport::smtp::Error> {
7676
let mut t = match mode {
7777
SmtpMode::Plain => AsyncSmtpTransport::<Tokio1Executor>::builder_dangerous(hostname),
78-
SmtpMode::StartTls => {
79-
let tls_parameters =
80-
lettre::transport::smtp::client::TlsParameters::builder(hostname.to_owned())
81-
.dangerous_accept_invalid_certs(true)
82-
.build()?;
83-
84-
AsyncSmtpTransport::<Tokio1Executor>::builder_dangerous(hostname)
85-
.port(lettre::transport::smtp::SUBMISSION_PORT)
86-
.tls(lettre::transport::smtp::client::Tls::Required(
87-
tls_parameters,
88-
))
89-
}
90-
SmtpMode::Tls => {
91-
let tls_parameters =
92-
lettre::transport::smtp::client::TlsParameters::builder(hostname.to_owned())
93-
.dangerous_accept_invalid_certs(true)
94-
.build()?;
95-
96-
AsyncSmtpTransport::<Tokio1Executor>::builder_dangerous(hostname)
97-
.port(lettre::transport::smtp::SUBMISSIONS_PORT)
98-
.tls(lettre::transport::smtp::client::Tls::Wrapper(
99-
tls_parameters,
100-
))
101-
}
78+
SmtpMode::StartTls => AsyncSmtpTransport::<Tokio1Executor>::starttls_relay(hostname)?,
79+
SmtpMode::Tls => AsyncSmtpTransport::<Tokio1Executor>::relay(hostname)?,
10280
};
10381

10482
if let Some(credentials) = credentials {

0 commit comments

Comments
 (0)