[MEDIUM] implement SMTP health checks

Peter van Dijk contributed this patch which implements the "smtpchk"
option, which is to SMTP what "httpchk" is to HTTP. By default, it sends
"HELO localhost" to the servers, and waits for the 250 message, but it
can also send a specific request.
diff --git a/src/checks.c b/src/checks.c
index 14f0c8c..ec56453 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -122,7 +122,8 @@
 	if (s->result != -1) {
 		/* we don't want to mark 'UP' a server on which we detected an error earlier */
 		if ((s->proxy->options & PR_O_HTTP_CHK) ||
-		    (s->proxy->options & PR_O_SSL3_CHK)) {
+		    (s->proxy->options & PR_O_SSL3_CHK) ||
+		    (s->proxy->options & PR_O_SMTP_CHK)) {
 			int ret;
 			/* we want to check if this host replies to HTTP or SSLv3 requests
 			 * so we'll send the request, and won't wake the checker up now.
@@ -252,6 +253,10 @@
 		/* SSLv3 alert or handshake */
 		result = 1;
 	}
+	else if ((s->proxy->options & PR_O_SMTP_CHK) && (len >= 3) &&
+		   (reply[0] == '2')) /* 2xx (should be 250) */ {
+		result = 1;
+	}
 
 	if (result == -1)
 		fdtab[fd].state = FD_STERROR;