str_append(cap_str, " LITERAL+");
}
- if (client_is_tls_enabled(client) && !client->tls)
+ if (client_is_tls_enabled(client) && !client->connection_tls_secured)
str_append(cap_str, " STARTTLS");
if (is_login_cmd_disabled(client))
str_append(cap_str, " LOGINDISABLED");
ssl_iostream_set_sni_callback(client->ssl_iostream,
client_sni_callback, client);
- client->tls = TRUE;
+ client->connection_tls_secured = TRUE;
client->connection_secured = TRUE;
client->end_client_tls_secured = TRUE;
void client_cmd_starttls(struct client *client)
{
- if (client->tls) {
+ if (client->connection_tls_secured) {
client->v.notify_starttls(client, FALSE, "TLS is already active.");
return;
}
{
int fds[2];
- if (!client->tls) {
+ if (!client->connection_tls_secured) {
/* Plaintext connection - We can send the fd directly to
the post-login process without any proxying. */
*fd_r = client->fd;
dec2str(client->local_port);
tab[VAR_EXPAND_ALIAS_INDEX_START + 3].value = tab[10].value =
dec2str(client->remote_port);
- if (!client->tls) {
+ if (!client->connection_tls_secured) {
tab[11].value = client->connection_secured ? "secured" : NULL;
tab[12].value = "";
} else if (client->proxied_ssl) {
bool login_success:1;
bool no_extra_disconnect_reason:1;
bool starttls:1;
- bool tls:1;
+ /* Client/proxy connection is using TLS. Dovecot has terminated the
+ TLS connection (not haproxy). */
+ bool connection_tls_secured:1;
bool proxied_ssl:1;
/* Connection from the previous hop (client, proxy, haproxy) is
considered secured. Either because TLS is used, or because the
if (client->ssl_iostream != NULL &&
ssl_iostream_has_valid_client_cert(client->ssl_iostream))
auth_flags |= AUTH_REQUEST_FLAG_VALID_CLIENT_CERT;
- if (client->tls || client->proxied_ssl)
+ if (client->connection_tls_secured || client->proxied_ssl)
auth_flags |= AUTH_REQUEST_FLAG_TRANSPORT_SECURITY_TLS;
if (client->connection_secured)
auth_flags |= AUTH_REQUEST_FLAG_SECURED;
str_append(str, "+OK\r\n");
str_append(str, capability_string);
- if (client_is_tls_enabled(&client->common) && !client->common.tls)
+ if (client_is_tls_enabled(&client->common) &&
+ !client->common.connection_tls_secured)
str_append(str, "STLS\r\n");
if (client->common.set->auth_allow_cleartext ||
client->common.connection_secured)
smtp_server_reply_ehlo_add(reply, "SIZE");
}
- if (client_is_tls_enabled(client) && !client->tls)
+ if (client_is_tls_enabled(client) &&
+ !client->connection_tls_secured)
smtp_server_reply_ehlo_add(reply, "STARTTLS");
if (!exotic_backend ||
(backend_caps & SMTP_CAPABILITY_PIPELINING) != 0)