This repository was archived by the owner on Sep 10, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed
Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -75,8 +75,30 @@ 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 => AsyncSmtpTransport :: < Tokio1Executor > :: starttls_relay ( hostname) ?,
79- SmtpMode :: Tls => AsyncSmtpTransport :: < Tokio1Executor > :: relay ( 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+ }
80102 } ;
81103
82104 if let Some ( credentials) = credentials {
You can’t perform that action at this time.
0 commit comments