summaryrefslogtreecommitdiffstats
path: root/plugins/check_smtp.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r--plugins/check_smtp.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c
index 24304534..1996c6d3 100644
--- a/plugins/check_smtp.c
+++ b/plugins/check_smtp.c
@@ -231,7 +231,7 @@ main (int argc, char **argv)
231 send(sd, SMTP_STARTTLS, strlen(SMTP_STARTTLS), 0); 231 send(sd, SMTP_STARTTLS, strlen(SMTP_STARTTLS), 0);
232 232
233 recvlines(buffer, MAX_INPUT_BUFFER); /* wait for it */ 233 recvlines(buffer, MAX_INPUT_BUFFER); /* wait for it */
234 if (!strstr (buffer, server_expect)) { 234 if (!strstr (buffer, SMTP_EXPECT)) {
235 printf (_("Server does not support STARTTLS\n")); 235 printf (_("Server does not support STARTTLS\n"));
236 smtp_quit(); 236 smtp_quit();
237 return STATE_UNKNOWN; 237 return STATE_UNKNOWN;
@@ -276,6 +276,7 @@ main (int argc, char **argv)
276# ifdef USE_OPENSSL 276# ifdef USE_OPENSSL
277 if ( check_cert ) { 277 if ( check_cert ) {
278 result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit); 278 result = np_net_ssl_check_cert(days_till_exp_warn, days_till_exp_crit);
279 smtp_quit();
279 my_close(); 280 my_close();
280 return result; 281 return result;
281 } 282 }
@@ -581,11 +582,6 @@ process_arguments (int argc, char **argv)
581 usage4 (_("Timeout interval must be a positive integer")); 582 usage4 (_("Timeout interval must be a positive integer"));
582 } 583 }
583 break; 584 break;
584 case 'S':
585 /* starttls */
586 use_ssl = TRUE;
587 use_ehlo = TRUE;
588 break;
589 case 'D': 585 case 'D':
590 /* Check SSL cert validity */ 586 /* Check SSL cert validity */
591#ifdef USE_OPENSSL 587#ifdef USE_OPENSSL
@@ -607,9 +603,14 @@ process_arguments (int argc, char **argv)
607 days_till_exp_warn = atoi (optarg); 603 days_till_exp_warn = atoi (optarg);
608 } 604 }
609 check_cert = TRUE; 605 check_cert = TRUE;
606 ignore_send_quit_failure = TRUE;
610#else 607#else
611 usage (_("SSL support not available - install OpenSSL and recompile")); 608 usage (_("SSL support not available - install OpenSSL and recompile"));
612#endif 609#endif
610 case 'S':
611 /* starttls */
612 use_ssl = TRUE;
613 use_ehlo = TRUE;
613 break; 614 break;
614 case '4': 615 case '4':
615 address_family = AF_INET; 616 address_family = AF_INET;
@@ -623,10 +624,10 @@ process_arguments (int argc, char **argv)
623 break; 624 break;
624 case 'V': /* version */ 625 case 'V': /* version */
625 print_revision (progname, NP_VERSION); 626 print_revision (progname, NP_VERSION);
626 exit (STATE_OK); 627 exit (STATE_UNKNOWN);
627 case 'h': /* help */ 628 case 'h': /* help */
628 print_help (); 629 print_help ();
629 exit (STATE_OK); 630 exit (STATE_UNKNOWN);
630 case '?': /* help */ 631 case '?': /* help */
631 usage5 (); 632 usage5 ();
632 } 633 }