[exim-dev] Re: [exim-cvs] cvs commit: exim/exim-doc/doc-txt …

Etusivu
Poista viesti
Vastaa
Lähettäjä: Tony Finch
Päiväys:  
Vastaanottaja: exim-dev
Aihe: [exim-dev] Re: [exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog NewStuff exim/exim-src/src acl.c globals.h smtp_in.c
On Mon, 22 Aug 2005, Philip Hazel wrote:
>   +
>   +PH/07 $smtp_command_argument is now set for all SMTP commands, not just the
>   +      non-message ones. This makes it possible to inspect the complete command
>   +      for RCPT commands, for example.


Hmm, this isn't quite sufficient because it omits the actual command and
any following space. How about this:

--- expand.c    23 Aug 2005 08:46:33 -0000      1.41
+++ expand.c    9 Sep 2005 17:30:28 -0000
@@ -482,6 +482,7 @@
   { "sender_rcvhost",      vtype_stringptr,   &sender_rcvhost },
   { "sender_verify_failure",vtype_stringptr,  &sender_verify_failure },
   { "smtp_active_hostname", vtype_stringptr,  &smtp_active_hostname },
+  { "smtp_command",        vtype_stringptr,   &cmd_buffer },
   { "smtp_command_argument", vtype_stringptr, &smtp_command_argument },
   { "sn0",                 vtype_filter_int,  &filter_sn[0] },
   { "sn1",                 vtype_filter_int,  &filter_sn[1] },
--- globals.c   7 Sep 2005 10:15:33 -0000       1.35
+++ globals.c   9 Sep 2005 17:30:29 -0000
@@ -370,6 +370,7 @@
 int     check_spool_space      = 0;
 int     clmacro_count          = 0;
 uschar *clmacros[MAX_CLMACROS];
+uschar *cmd_buffer             = NULL;
 BOOL    config_changed         = FALSE;
 FILE   *config_file            = NULL;
 uschar *config_filename        = NULL;
--- globals.h   7 Sep 2005 10:15:33 -0000       1.27
+++ globals.h   9 Sep 2005 17:30:29 -0000
@@ -199,6 +199,7 @@
 extern int     check_spool_space;      /* Minimum for message acceptance */
 extern int     clmacro_count;          /* Number of command line macros */
 extern uschar *clmacros[];             /* Copy of them, for re-exec */
+extern uschar *cmd_buffer;             /* SMTP command buffer */
 extern int     connection_max_messages;/* Max down one SMTP connection */
 extern BOOL    config_changed;         /* True if -C used */
 extern FILE   *config_file;            /* Configuration file */
--- smtp_in.c   7 Sep 2005 10:15:33 -0000       1.24
+++ smtp_in.c   9 Sep 2005 17:30:29 -0000
@@ -119,8 +119,6 @@
 static int  sync_cmd_limit;
 static int  smtp_write_error = 0;


-static uschar *cmd_buffer;
-
/* We need to know the position of RSET, HELO, EHLO, AUTH, and STARTTLS. Their
final fields of all except AUTH are forced TRUE at the start of a new message
setup, to allow one of each between messages that is not counted as a nonmail
@@ -455,7 +453,7 @@
There are sites that don't do this, and in any case internal SMTP probably
should check only for LF. Consequently, we check here for LF only. The line
ends up with [CR]LF removed from its end. If we get an overlong line, treat as
-an unknown command. The command is read into the static cmd_buffer.
+an unknown command. The command is read into the cmd_buffer.

The character reading routine sets up a timeout for each block actually read
from the input (which may contain more than one command). We set up a special


Tony.
--
<fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}