[exim-cvs] cvs commit: exim/exim-src/src exim.c smtp_in.c e…

Etusivu
Poista viesti
Vastaa
Lähettäjä: Philip Hazel
Päiväys:  
Vastaanottaja: exim-cvs
Aihe: [exim-cvs] cvs commit: exim/exim-src/src exim.c smtp_in.c exim/exim-src/src/routers redirect.c exim/exim-test/scripts/0000-Basic 0546 exim/exim-test/stdout 0546
ph10 2006/11/20 11:43:40 GMT

  Modified files:
    exim-src/src         exim.c smtp_in.c 
    exim-src/src/routers redirect.c 
    exim-test/scripts/0000-Basic 0546 
    exim-test/stdout     0546 
  Log:
  Fix space bug in previous patch for "message" used with "accept".


  Revision  Changes    Path
  1.50      +2 -1      exim/exim-src/src/exim.c
  1.18      +2 -2      exim/exim-src/src/routers/redirect.c
  1.48      +13 -8     exim/exim-src/src/smtp_in.c
  1.2       +4 -0      exim/exim-test/scripts/0000-Basic/0546
  1.2       +6 -0      exim/exim-test/stdout/0546


  Index: exim.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/exim.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- exim.c    13 Nov 2006 11:56:41 -0000    1.49
  +++ exim.c    20 Nov 2006 11:43:40 -0000    1.50
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/exim.c,v 1.49 2006/11/13 11:56:41 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/exim.c,v 1.50 2006/11/20 11:43:40 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1498,7 +1498,8 @@
     regex_must_compile(US"^(?:[^\\W_]{6}-){2}[^\\W_]{2}$", FALSE, TRUE);


/* Precompile the regular expression that is used for matching an SMTP error
-code, possibly extended, at the start of an error message. */
+code, possibly extended, at the start of an error message. Note that the
+terminating whitespace character is included. */

   regex_smtp_code =
     regex_must_compile(US"^\\d\\d\\d\\s(?:\\d\\.\\d\\d?\\d?\\.\\d\\d?\\d?\\s)?",


  Index: smtp_in.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/smtp_in.c,v
  retrieving revision 1.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- smtp_in.c    14 Nov 2006 16:40:36 -0000    1.47
  +++ smtp_in.c    20 Nov 2006 11:43:40 -0000    1.48
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/smtp_in.c,v 1.47 2006/11/14 16:40:36 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/smtp_in.c,v 1.48 2006/11/20 11:43:40 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1605,7 +1605,7 @@
     int codelen = 3;
     s = user_msg;
     smtp_message_code(&code, &codelen, &s, NULL);
  -  if (codelen > 3)
  +  if (codelen > 4)
       {
       esc = code + 4;
       esclen = codelen - 4;
  @@ -1793,7 +1793,7 @@


   Arguments:
     code          SMTP code, may involve extended status codes
  -  codelen       length of smtp code; if > 3 there's an ESC
  +  codelen       length of smtp code; if > 4 there's an ESC
     final         FALSE if the last line isn't the final line
     msg           message text, possibly containing newlines


@@ -1808,7 +1808,7 @@

if (!final && no_multiline_responses) return;

  -if (codelen > 3)
  +if (codelen > 4)
     {
     esc = code + 4;
     esclen = codelen - 4;
  @@ -1856,9 +1856,12 @@
   This function is global because it is called from receive.c as well as within
   this module.


  +Note that the code length returned includes the terminating whitespace
  +character, which is always included in the regex match.
  +
   Arguments:
     code          SMTP code, may involve extended status codes
  -  codelen       length of smtp code; if > 3 there's an ESC
  +  codelen       length of smtp code; if > 4 there's an ESC
     msg           message text
     log_msg       optional log message, to be adjusted with the new SMTP code


  @@ -2650,7 +2653,7 @@
       tls_advertised = FALSE;
       #endif


  -    smtp_code = US"250";        /* Default response code */
  +    smtp_code = US"250 ";        /* Default response code plus space*/
       if (user_msg == NULL)
         {
         s = string_sprintf("%.3s %s Hello %s%s%s",
  @@ -2672,14 +2675,16 @@
           }
         }


  -    /* A user-supplied EHLO greeting may not contain more than one line */
  +    /* A user-supplied EHLO greeting may not contain more than one line. Note
  +    that the code returned by smtp_message_code() includes the terminating
  +    whitespace character. */


       else
         {
         char *ss;
  -      int codelen = 3;
  +      int codelen = 4;
         smtp_message_code(&smtp_code, &codelen, &user_msg, NULL);
  -      s = string_sprintf("%.*s %s", codelen, smtp_code, user_msg);
  +      s = string_sprintf("%.*s%s", codelen, smtp_code, user_msg);
         if ((ss = strpbrk(CS s, "\r\n")) != NULL)
           {
           log_write(0, LOG_MAIN|LOG_PANIC, "EHLO/HELO response must not contain "


  Index: redirect.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/routers/redirect.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- redirect.c    13 Jul 2006 13:53:33 -0000    1.17
  +++ redirect.c    20 Nov 2006 11:43:40 -0000    1.18
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/routers/redirect.c,v 1.17 2006/07/13 13:53:33 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/routers/redirect.c,v 1.18 2006/11/20 11:43:40 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -736,8 +736,8 @@
       int ovector[3];
       if (ob->forbid_smtp_code &&
           pcre_exec(regex_smtp_code, NULL, CS addr->message,
  -        Ustrlen(addr->message), 0, PCRE_EOPT,
  -        ovector, sizeof(ovector)/sizeof(int)) >= 0)
  +          Ustrlen(addr->message), 0, PCRE_EOPT,
  +          ovector, sizeof(ovector)/sizeof(int)) >= 0)
         {
         DEBUG(D_route) debug_printf("SMTP code at start of error message "
           "is ignored because forbid_smtp_code is set\n");


  Index: 0546
  ===================================================================
  RCS file: /home/cvs/exim/exim-test/scripts/0000-Basic/0546,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- 0546    14 Nov 2006 16:40:36 -0000    1.1
  +++ 0546    20 Nov 2006 11:43:40 -0000    1.2
  @@ -16,4 +16,8 @@
   rcpt to:<userx@???>
   quit
   ****
  +exim -bs -DHELO_MSG='299 With code'
  +ehlo a.b.c
  +quit
  +****
   no_msglog_check


  Index: 0546
  ===================================================================
  RCS file: /home/cvs/exim/exim-test/stdout/0546,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- 0546    14 Nov 2006 16:40:36 -0000    1.1
  +++ 0546    20 Nov 2006 11:43:40 -0000    1.2
  @@ -18,3 +18,9 @@
   299 OK
   250 Bad number
   221 the.local.host.name closing connection
  +220 the.local.host.name ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
  +299-With code
  +299-SIZE 52428800
  +299-PIPELINING
  +299 HELP
  +221 the.local.host.name closing connection