Revision: 335
Author: mmo...@tildeslash.com
Date: Mon Mar  7 00:29:06 2011
Log: * Fix Debian bug #614984: smtp protocol test issues both EHLO and HELO.
  Thanks to Sergey B Kirpichev for report.


http://code.google.com/p/monit/source/detail?r=335

Modified:
 /trunk/CHANGES.txt
 /trunk/protocols/smtp.c

=======================================
--- /trunk/CHANGES.txt  Tue Mar  1 11:39:55 2011
+++ /trunk/CHANGES.txt  Mon Mar  7 00:29:06 2011
@@ -9,9 +9,12 @@

 Version 5.2.5

-* bug #32583: Multiple SIP OPTIONS messages use the same header data.
+* Fix bug #32583: Multiple SIP OPTIONS messages use the same header data.
   Thanks to Hugh Waite for patch.

+* Fix Debian bug #614984: smtp protocol test issues both EHLO and HELO.
+  Thanks to Sergey B Kirpichev for report.
+
 * AIX: Fix the time display which was off by GMT difference. Thanks to
   Helen Chen for report.

=======================================
--- /trunk/protocols/smtp.c     Wed Jan 19 10:40:32 2011
+++ /trunk/protocols/smtp.c     Mon Mar  7 00:29:06 2011
@@ -63,17 +63,11 @@
 int check_smtp(Socket_T s) {
   ASSERT(s);

-  if (! expect(s, 220, TRUE))
-    return FALSE;
-
   /* Try HELO also before giving up as of rfc2821 4.1.1.1 */
- if (! (say(s, "EHLO localhost\r\n") && expect(s, 250, FALSE)) || ! (say(s, "HELO localhost\r\n") && expect(s, 250, TRUE)))
-    return FALSE;
-
-  if (! (say(s, "QUIT\r\n") && expect(s, 221, TRUE)))
-    return FALSE;
-
-  return TRUE;
+ if (expect(s, 220, TRUE) && ((say(s, "EHLO localhost\r\n") && expect(s, 250, FALSE)) || (say(s, "HELO localhost\r\n") && expect(s, 250, TRUE))) && (say(s, "QUIT\r\n") && expect(s, 221, TRUE)))
+    return TRUE;
+
+  return FALSE;
 }



_______________________________________________
monit-dev mailing list
monit-dev@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monit-dev

Reply via email to