From 084efe8d7243ef5184443e2c7075e80074476703 Mon Sep 17 00:00:00 2001 From: Philip Hazel Date: Thu, 27 Jul 2006 11:29:32 +0000 Subject: [PATCH] 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. --- doc/doc-txt/ChangeLog | 7 ++++++- src/src/smtp_in.c | 7 +++++-- test/scripts/0000-Basic/0089 | 4 ++++ test/stdout/0089 | 4 ++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index c3f20ab70..71646ced2 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -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 ----------------- diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 531eaabe4..3b1f6a33e 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -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 */ diff --git a/test/scripts/0000-Basic/0089 b/test/scripts/0000-Basic/0089 index d7ddbd6cb..1fcd8dfdf 100644 --- a/test/scripts/0000-Basic/0089 +++ b/test/scripts/0000-Basic/0089 @@ -16,6 +16,10 @@ helo @#$%^&*() mail from: rcpt to: rcpt to: +rset +helorhubarb +mailfrom:<> +rsettling quit **** 2 diff --git a/test/stdout/0089 b/test/stdout/0089 index 916f0acb5..02576912e 100644 --- a/test/stdout/0089 +++ b/test/stdout/0089 @@ -25,6 +25,10 @@ userx@myhost.test.ex 250 OK 250 Accepted 550 relay not permitted +250 Reset OK +500 unrecognized command +500 unrecognized command +500 unrecognized command 221 myhost.test.ex closing connection abcd@test.ex router = select, transport = dummy -- 2.25.1