Skip to content

Commit

Permalink
lib-smtp: server: Add smtp_server_connection_set_ssl_streams().
Browse files Browse the repository at this point in the history
It wraps smtp_server_connection_set_streams() and additionally marks the connection as SSL-secured.
  • Loading branch information
stephanbosch committed Dec 21, 2017
1 parent 9249c80 commit 55f1e5a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/lib-smtp/smtp-server-connection.c
Expand Up @@ -205,6 +205,15 @@ void smtp_server_connection_set_streams(struct smtp_server_connection *conn,
smtp_server_connection_streams_changed(conn);
}

void smtp_server_connection_set_ssl_streams(struct smtp_server_connection *conn,
struct istream *input, struct ostream *output)
{
conn->ssl_secured = TRUE;
conn->set.capabilities &= ~SMTP_CAPABILITY_STARTTLS;

smtp_server_connection_set_streams(conn, input, output);
}

static void
smtp_server_connection_idle_timeout(struct smtp_server_connection *conn)
{
Expand Down
6 changes: 4 additions & 2 deletions src/lib-smtp/smtp-server.h
Expand Up @@ -307,8 +307,10 @@ void smtp_server_connection_login(struct smtp_server_connection *conn,

void smtp_server_connection_input_lock(struct smtp_server_connection *conn);
void smtp_server_connection_input_unlock(struct smtp_server_connection *conn);
void smtp_server_connection_set_streams(
struct smtp_server_connection *_conn,

void smtp_server_connection_set_streams(struct smtp_server_connection *conn,
struct istream *input, struct ostream *output);
void smtp_server_connection_set_ssl_streams(struct smtp_server_connection *conn,
struct istream *input, struct ostream *output);

void smtp_server_connection_close(struct smtp_server_connection **_conn,
Expand Down

0 comments on commit 55f1e5a

Please sign in to comment.