summaryrefslogtreecommitdiffstats
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
authorFranz Schwartau <franz@electromail.org>2023-06-14 18:25:50 (GMT)
committerFranz Schwartau <franz@electromail.org>2023-08-29 07:46:50 (GMT)
commitda81dd3cf29c16ff1f9cf735482b9d4a0619f501 (patch)
tree096f727cd34464a1d2569d650e516dddd54fda45 /plugins/check_smtp.c
parente823896d8a39618e0cb60c5cd4e46f13bbc6a51d (diff)
downloadmonitoring-plugins-da81dd3cf29c16ff1f9cf735482b9d4a0619f501.tar.gz
check_smtp: remove restriction of --proxy with --ssl
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r--plugins/check_smtp.c18
1 files changed, 7 insertions, 11 deletions
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)
188 result = my_tcp_connect (server_address, server_port, &sd); 188 result = my_tcp_connect (server_address, server_port, &sd);
189 189
190 if (result == STATE_OK) { /* we connected */ 190 if (result == STATE_OK) { /* we connected */
191 /* If requested, send PROXY header */
192 if (use_proxy_prefix) {
193 if (verbose)
194 printf ("Sending header %s\n", PROXY_PREFIX);
195 my_send(PROXY_PREFIX, strlen(PROXY_PREFIX));
196 }
197
191#ifdef HAVE_SSL 198#ifdef HAVE_SSL
192 if (use_ssl) { 199 if (use_ssl) {
193 result = np_net_ssl_init_with_hostname(sd, (use_sni ? server_address : NULL)); 200 result = np_net_ssl_init_with_hostname(sd, (use_sni ? server_address : NULL));
@@ -202,13 +209,6 @@ main (int argc, char **argv)
202 } 209 }
203#endif 210#endif
204 211
205 /* If requested, send PROXY header */
206 if (use_proxy_prefix) {
207 if (verbose)
208 printf ("Sending header %s\n", PROXY_PREFIX);
209 my_send(PROXY_PREFIX, strlen(PROXY_PREFIX));
210 }
211
212 /* watch for the SMTP connection string and */ 212 /* watch for the SMTP connection string and */
213 /* return a WARNING status if we couldn't read any data */ 213 /* return a WARNING status if we couldn't read any data */
214 if (recvlines(buffer, MAX_INPUT_BUFFER) <= 0) { 214 if (recvlines(buffer, MAX_INPUT_BUFFER) <= 0) {
@@ -718,10 +718,6 @@ process_arguments (int argc, char **argv)
718 usage4 (_("Set either -s/--ssl or -S/--starttls")); 718 usage4 (_("Set either -s/--ssl or -S/--starttls"));
719 } 719 }
720 720
721 if (use_ssl && use_proxy_prefix) {
722 usage4 (_("PROXY protocol (-r/--proxy) is not implemented with SSL/TLS (-s/--ssl), yet."));
723 }
724
725 return validate_arguments (); 721 return validate_arguments ();
726} 722}
727 723