From da81dd3cf29c16ff1f9cf735482b9d4a0619f501 Mon Sep 17 00:00:00 2001 From: Franz Schwartau Date: Wed, 14 Jun 2023 20:25:50 +0200 Subject: check_smtp: remove restriction of --proxy with --ssl diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index 474557d..4ceb956 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c @@ -188,6 +188,13 @@ main (int argc, char **argv) result = my_tcp_connect (server_address, server_port, &sd); if (result == STATE_OK) { /* we connected */ + /* If requested, send PROXY header */ + if (use_proxy_prefix) { + if (verbose) + printf ("Sending header %s\n", PROXY_PREFIX); + my_send(PROXY_PREFIX, strlen(PROXY_PREFIX)); + } + #ifdef HAVE_SSL if (use_ssl) { result = np_net_ssl_init_with_hostname(sd, (use_sni ? server_address : NULL)); @@ -202,13 +209,6 @@ main (int argc, char **argv) } #endif - /* If requested, send PROXY header */ - if (use_proxy_prefix) { - if (verbose) - printf ("Sending header %s\n", PROXY_PREFIX); - my_send(PROXY_PREFIX, strlen(PROXY_PREFIX)); - } - /* watch for the SMTP connection string and */ /* return a WARNING status if we couldn't read any data */ if (recvlines(buffer, MAX_INPUT_BUFFER) <= 0) { @@ -718,10 +718,6 @@ process_arguments (int argc, char **argv) usage4 (_("Set either -s/--ssl or -S/--starttls")); } - if (use_ssl && use_proxy_prefix) { - usage4 (_("PROXY protocol (-r/--proxy) is not implemented with SSL/TLS (-s/--ssl), yet.")); - } - return validate_arguments (); } -- cgit v0.10-9-g596f