From: Timo Sirainen Date: Mon, 14 Nov 2022 14:33:33 +0000 (+0200) Subject: lmtp: Add support for haproxy SSL flag X-Git-Tag: 2.4.0~3404 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=50007ae6e80d3ca2ea7f88a9ecbbfe57c7144a59;p=thirdparty%2Fdovecot%2Fcore.git lmtp: Add support for haproxy SSL flag --- diff --git a/src/lmtp/lmtp-client.c b/src/lmtp/lmtp-client.c index dbb7195be4..79e828219e 100644 --- a/src/lmtp/lmtp-client.c +++ b/src/lmtp/lmtp-client.c @@ -154,6 +154,7 @@ struct client *client_create(int fd_in, int fd_out, struct smtp_server_settings lmtp_set; struct client *client; pool_t pool; + bool conn_tls = conn->ssl || (conn->haproxied && conn->haproxy.ssl); pool = pool_alloconly_create("lmtp client", 2048); client = p_new(pool, struct client, 1); @@ -172,7 +173,7 @@ struct client *client_create(int fd_in, int fd_out, client->event = event_create(NULL); event_add_category(client->event, &event_category_lmtp); - client_read_settings(client, conn->ssl); + client_read_settings(client, conn_tls); client_raw_user_create(client); client_load_modules(client); client->my_domain = client->unexpanded_lda_set->hostname; @@ -190,7 +191,7 @@ struct client *client_create(int fd_in, int fd_out, SMTP_CAPABILITY_CHUNKING | SMTP_CAPABILITY_XCLIENT | SMTP_CAPABILITY__ORCPT; - if (!conn->ssl && master_service_ssl_is_enabled(master_service)) + if (!conn_tls && master_service_ssl_is_enabled(master_service)) lmtp_set.capabilities |= SMTP_CAPABILITY_STARTTLS; lmtp_set.hostname = client->unexpanded_lda_set->hostname; lmtp_set.login_greeting = client->lmtp_set->login_greeting;