Exim was not testing for a space following SMTP commands such as EHLO
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Thu, 27 Jul 2006 11:29:32 +0000 (11:29 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Thu, 27 Jul 2006 11:29:32 +0000 (11:29 +0000)
that require one. Thus, EHLORHUBARB was interpreted as a valid command.
This bug exists in every version of Exim that I still have, right back
to 0.12.

doc/doc-txt/ChangeLog
src/src/smtp_in.c
test/scripts/0000-Basic/0089
test/stdout/0089

index c3f20ab70cf94e7e3b4c4601e9eacdc92e460bd4..71646ced2035f0c32cded3a0e0a071afb43fe5f4 100644 (file)
@@ -1,4 +1,4 @@
-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.382 2006/07/27 10:36:34 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.383 2006/07/27 11:29:32 ph10 Exp $
 
 Change log file for Exim from version 4.21
 -------------------------------------------
@@ -135,6 +135,11 @@ PH/24 Re-jigged the order of the tests in the default configuration so that the
       tests for valid domains and recipients precede the DNS black list and CSA
       tests, on the grounds that those ones are more expensive.
 
+PH/25 Exim was not testing for a space following SMTP commands such as EHLO
+      that require one. Thus, EHLORHUBARB was interpreted as a valid command.
+      This bug exists in every version of Exim that I still have, right back to
+      0.12.
+
 
 Exim version 4.62
 -----------------
index 531eaabe424cb933522a1d52b1e077c1917d1064..3b1f6a33ef650ce01a4f1f559969892531c4e00a 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/smtp_in.c,v 1.40 2006/07/27 10:13:52 ph10 Exp $ */
+/* $Cambridge: exim/src/src/smtp_in.c,v 1.41 2006/07/27 11:29:32 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -523,7 +523,10 @@ if required. */
 
 for (p = cmd_list; p < cmd_list_end; p++)
   {
-  if (strncmpic(smtp_cmd_buffer, US p->name, p->len) == 0)
+  if (strncmpic(smtp_cmd_buffer, US p->name, p->len) == 0 &&
+       (smtp_cmd_buffer[p->len-1] == ':' ||   /* "mail from:" or "rcpt to:" */
+        smtp_cmd_buffer[p->len] == 0 ||
+        smtp_cmd_buffer[p->len] == ' '))
     {
     if (smtp_inptr < smtp_inend &&                     /* Outstanding input */
         p->cmd < sync_cmd_limit &&                     /* Command should sync */
index d7ddbd6cb2001d7c020d54b044f8b1a07508c6fe..1fcd8dfdfdfdedb185e7f5c42ba1f023ebe56bb1 100644 (file)
@@ -16,6 +16,10 @@ helo @#$%^&*()
 mail from:<root>
 rcpt to:<xx@reLAY.ONE.ex>
 rcpt to:<yy@relay.two.ex>
+rset
+helorhubarb
+mailfrom:<>
+rsettling
 quit
 ****
 2
index 916f0acb59605eea66f29c93dcf79c4b441ada9a..02576912e1c71e67a689a79008169c65930e46cf 100644 (file)
@@ -25,6 +25,10 @@ userx@myhost.test.ex
 250 OK\r
 250 Accepted\r
 550 relay not permitted\r
+250 Reset OK\r
+500 unrecognized command\r
+500 unrecognized command\r
+500 unrecognized command\r
 221 myhost.test.ex closing connection\r
 abcd@test.ex
   router = select, transport = dummy