summaryrefslogtreecommitdiffstats
path: root/web/attachments/176994-check-smtp-ehlo.diff
diff options
context:
space:
mode:
Diffstat (limited to 'web/attachments/176994-check-smtp-ehlo.diff')
-rw-r--r--web/attachments/176994-check-smtp-ehlo.diff43
1 files changed, 43 insertions, 0 deletions
diff --git a/web/attachments/176994-check-smtp-ehlo.diff b/web/attachments/176994-check-smtp-ehlo.diff
new file mode 100644
index 0000000..d40329a
--- /dev/null
+++ b/web/attachments/176994-check-smtp-ehlo.diff
@@ -0,0 +1,43 @@
1Index: check_smtp.c
2===================================================================
3RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_smtp.c,v
4retrieving revision 1.50
5diff -u -r1.50 check_smtp.c
6--- check_smtp.c 2 Nov 2005 08:47:26 -0000 1.50
7+++ check_smtp.c 6 May 2006 01:41:30 -0000
8@@ -270,6 +270,35 @@
9 } else {
10 ssl_established = 1;
11 }
12+
13+ /*
14+ * Resend the EHLO command.
15+ *
16+ * RFC 3207 (4.2) says: ``The client MUST discard any knowledge
17+ * obtained from the server, such as the list of SMTP service
18+ * extensions, which was not obtained from the TLS negotiation
19+ * itself. The client SHOULD send an EHLO command as the first
20+ * command after a successful TLS negotiation.'' For this
21+ * reason, some MTAs will not allow an AUTH LOGIN command before
22+ * we resent EHLO via TLS.
23+ */
24+ if (my_send(helocmd, strlen(helocmd)) <= 0) {
25+ printf(_("SMTP UNKNOWN - Cannot send EHLO command via TLS.\n"));
26+ my_close();
27+ return STATE_UNKNOWN;
28+ }
29+ if (verbose)
30+ printf(_("sent %s"), helocmd);
31+ if ((n = my_recv(buffer, MAX_INPUT_BUFFER - 1)) <= 0) {
32+ printf(_("SMTP UNKNOWN - Cannot read EHLO response via TLS.\n"));
33+ my_close();
34+ return STATE_UNKNOWN;
35+ }
36+ if (verbose) {
37+ buffer[n] = '\0';
38+ printf("%s", buffer);
39+ }
40+
41 # ifdef USE_OPENSSL
42 if ( check_cert ) {
43 result = np_net_ssl_check_cert(days_till_exp);