Browse Source
Revert "Use opportunistic TLS in SMTP connections"
pull/918/head
Daniel García
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
9 additions and
9 deletions
-
src/mail.rs
|
|
@ -18,21 +18,21 @@ use chrono::NaiveDateTime; |
|
|
|
fn mailer() -> SmtpTransport { |
|
|
|
let host = CONFIG.smtp_host().unwrap(); |
|
|
|
|
|
|
|
let client_security = if CONFIG.smtp_ssl() { |
|
|
|
let tls = TlsConnector::builder() |
|
|
|
.min_protocol_version(Some(Protocol::Tlsv11)) |
|
|
|
.build() |
|
|
|
.unwrap(); |
|
|
|
|
|
|
|
let tls_params = ClientTlsParameters::new(host.clone(), tls); |
|
|
|
let params = ClientTlsParameters::new(host.clone(), tls); |
|
|
|
|
|
|
|
let client_security = if CONFIG.smtp_ssl() { |
|
|
|
if CONFIG.smtp_explicit_tls() { |
|
|
|
ClientSecurity::Wrapper(tls_params) |
|
|
|
ClientSecurity::Wrapper(params) |
|
|
|
} else { |
|
|
|
ClientSecurity::Required(tls_params) |
|
|
|
ClientSecurity::Required(params) |
|
|
|
} |
|
|
|
} else { |
|
|
|
ClientSecurity::Opportunistic(tls_params) |
|
|
|
ClientSecurity::None |
|
|
|
}; |
|
|
|
|
|
|
|
use std::time::Duration; |
|
|
|