smtp: disable buffering while running STARTTLS

Otherwise TLS setup fails on macOS and iOS with `errSSLClosedAbort`.
(<https://developer.apple.com/documentation/security/errsslclosedabort>)
This commit is contained in:
link2xt
2023-03-21 16:15:23 +00:00
parent 9c15cd5c8f
commit 484aebdb16
2 changed files with 3 additions and 2 deletions

View File

@@ -22,6 +22,7 @@
- Delete expired messages using multiple SQL requests. #4158
- Do not emit "Failed to run incremental vacuum" warnings on success. #4160
- Ability to send backup over network and QR code to setup second device #4007
- Disable buffering during STARTTLS setup. #4190
## [1.111.0] - 2023-03-05

View File

@@ -143,7 +143,7 @@ impl Smtp {
// Run STARTTLS command and convert the client back into a stream.
let client = smtp::SmtpClient::new().smtp_utf8(true);
let transport = SmtpTransport::new(client, BufStream::new(socks5_stream)).await?;
let tcp_stream = transport.starttls().await?;
let tcp_stream = transport.starttls().await?.into_inner();
let tls_stream = wrap_tls(strict_tls, hostname, tcp_stream)
.await
.context("STARTTLS upgrade failed")?;
@@ -199,7 +199,7 @@ impl Smtp {
// Run STARTTLS command and convert the client back into a stream.
let client = smtp::SmtpClient::new().smtp_utf8(true);
let transport = SmtpTransport::new(client, BufStream::new(tcp_stream)).await?;
let tcp_stream = transport.starttls().await?;
let tcp_stream = transport.starttls().await?.into_inner();
let tls_stream = wrap_tls(strict_tls, hostname, tcp_stream)
.await
.context("STARTTLS upgrade failed")?;