[Nagiosplug-devel] Recent patch to check_smtp.c

Benjamin Madsen benmadsenx at attbi.com
Thu Jun 13 13:30:01 CEST 2002

Thank you Tom, I need to learn to check the RFC's for this stuff more often.

The attached patch will change the SMTP_DUMMYCMD to use \r\n to terminate 
the command to more closely follow RFC 821.


At 04:08 PM 6/13/2002 -0400, Tom wrote:
>The SMTP protocol says (RFC 821):
>       4.1.1.  COMMAND SEMANTICS
>          The SMTP commands define the mail transfer or the mail system
>          function requested by the user.  SMTP commands are character
>          strings terminated by <CRLF>.  The command codes themselves are
>          alphabetic characters terminated by <SP> if parameters follow
>          and <CRLF> otherwise.  The syntax of mailboxes must conform to
>          receiver site conventions.  The SMTP commands are discussed
>          below.  The SMTP replies are discussed in the Section 4.2.
>I've never encountered a system that cannot handle \r\n.
>Tom Bertelson                "Any sufficient advanced technlogy
>GE Card Services              is indistinguishable from magic."
>Tom.Bertelson at gecapital.com      -- Arthur C. Clarke

--- check_smtp.c        Thu Jun 13 13:21:46 2002
+++ check_smtp.c       Thu Jun 13 13:26:43 2002
@@ -48,9 +48,9 @@
   * even if syntax is illegal (MAIL requires a FROM:<...> argument)
   * You can disable sending DUMMYCMD by undefining SMTP_USE_DUMMYCMD.
-#define SMTP_DUMMYCMD  "MAIL\n"
+#define SMTP_DUMMYCMD  "MAIL\r\n"
-#define SMTP_QUIT      "QUIT\n"
+#define SMTP_QUIT      "QUIT\r\n"

  int process_arguments (int, char **);
  int call_getopt (int, char **);

More information about the Devel mailing list