@@ -376,7 +376,7 @@ fn get_offline_autoconfig(context: &Context, param: &LoginParam) -> Option<Login
376
376
p. mail_server = imap. hostname . to_string ( ) ;
377
377
p. mail_user = imap. apply_username_pattern ( param. addr . clone ( ) ) ;
378
378
p. mail_port = imap. port as i32 ;
379
- p. imap_certificate_checks = CertificateChecks :: AcceptInvalidCertificates ;
379
+ p. imap_certificate_checks = CertificateChecks :: Automatic ;
380
380
p. server_flags |= match imap. socket {
381
381
provider:: Socket :: STARTTLS => DC_LP_IMAP_SOCKET_STARTTLS ,
382
382
provider:: Socket :: SSL => DC_LP_IMAP_SOCKET_SSL ,
@@ -385,7 +385,7 @@ fn get_offline_autoconfig(context: &Context, param: &LoginParam) -> Option<Login
385
385
p. send_server = smtp. hostname . to_string ( ) ;
386
386
p. send_user = smtp. apply_username_pattern ( param. addr . clone ( ) ) ;
387
387
p. send_port = smtp. port as i32 ;
388
- p. smtp_certificate_checks = CertificateChecks :: AcceptInvalidCertificates ;
388
+ p. smtp_certificate_checks = CertificateChecks :: Automatic ;
389
389
p. server_flags |= match smtp. socket {
390
390
provider:: Socket :: STARTTLS => DC_LP_SMTP_SOCKET_STARTTLS as i32 ,
391
391
provider:: Socket :: SSL => DC_LP_SMTP_SOCKET_SSL as i32 ,
@@ -706,5 +706,14 @@ mod tests {
706
706
let found_params = get_offline_autoconfig ( & context, & params) . unwrap ( ) ;
707
707
assert_eq ! ( found_params. mail_server, "imap.nauta.cu" . to_string( ) ) ;
708
708
assert_eq ! ( found_params. send_server, "smtp.nauta.cu" . to_string( ) ) ;
709
+
710
+ assert_eq ! (
711
+ found_params. imap_certificate_checks,
712
+ CertificateChecks :: Automatic
713
+ ) ;
714
+ assert_eq ! (
715
+ found_params. smtp_certificate_checks,
716
+ CertificateChecks :: Automatic
717
+ ) ;
709
718
}
710
719
}
0 commit comments