summaryrefslogtreecommitdiffstats
path: root/web/attachments/27407-nagios-plugins-check_smtp.patch
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2013-09-29 22:03:24 (GMT)
committerHolger Weiss <holger@zedat.fu-berlin.de>2013-09-29 22:03:24 (GMT)
commit0b6423f9c99d9edf8c96fefd0f6c453859395aa1 (patch)
tree1c2b6b21704a294940f87c7892676998d8371707 /web/attachments/27407-nagios-plugins-check_smtp.patch
downloadsite-0b6423f9c99d9edf8c96fefd0f6c453859395aa1.tar.gz
Import Nagios Plugins site
Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files.
Diffstat (limited to 'web/attachments/27407-nagios-plugins-check_smtp.patch')
-rw-r--r--web/attachments/27407-nagios-plugins-check_smtp.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/web/attachments/27407-nagios-plugins-check_smtp.patch b/web/attachments/27407-nagios-plugins-check_smtp.patch
new file mode 100644
index 0000000..be08038
--- /dev/null
+++ b/web/attachments/27407-nagios-plugins-check_smtp.patch
@@ -0,0 +1,52 @@
1--- nagios-plugins/plugins/check_smtp.c Thu Jun 13 13:49:38 2002
2+++ nagios-plugins.patched/plugins/check_smtp.c Fri Jul 19 14:03:19 2002
3@@ -50,8 +50,13 @@
4 */
5 #define SMTP_DUMMYCMD "MAIL\r\n"
6 #define SMTP_USE_DUMMYCMD 1
7+#define SMTP_USE_HELOCMD 1
8 #define SMTP_QUIT "QUIT\r\n"
9
10+#ifdef SMTP_USE_HELOCMD
11+#undef SMTP_USE_DUMMYCMD
12+#endif /* SMTP_USE_HELOCMD */
13+
14 int process_arguments (int, char **);
15 int call_getopt (int, char **);
16 int validate_arguments (void);
17@@ -74,6 +79,10 @@
18 int sd;
19 int result;
20 char buffer[MAX_INPUT_BUFFER] = "";
21+#ifdef SMTP_USE_HELOCMD
22+ char helocmd[255] = "HELO ";
23+ char myhostname[248];
24+#endif /* SMTP_USE_HELOCMD */
25
26 if (process_arguments (argc, argv) != OK)
27 usage ("Invalid command arguments supplied\n");
28@@ -137,13 +146,22 @@
29 }
30 }
31
32- /* close the connection */
33+#ifdef SMTP_USE_HELOCMD
34+ gethostname(myhostname, sizeof(myhostname));
35+ strcat(helocmd,myhostname);
36+ strcat(helocmd,"\r\n");
37+ send(sd,helocmd,strlen(helocmd),0);
38+ /* allow for response to helo command to reach us */
39+ recv(sd,buffer,MAX_INPUT_BUFFER-1,0);
40+#endif /* SMTP_USE_HELOCMD */
41+
42 #ifdef SMTP_USE_DUMMYCMD
43 send(sd,SMTP_DUMMYCMD,strlen(SMTP_DUMMYCMD),0);
44 /* allow for response to DUMMYCMD to reach us */
45 recv(sd,buffer,MAX_INPUT_BUFFER-1,0);
46 #endif /* SMTP_USE_DUMMYCMD */
47
48+ /* close the connection */
49 send (sd, SMTP_QUIT, strlen (SMTP_QUIT), 0);
50 close (sd);
51 }
52