[exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog exim…

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: exim-cvs
Tárgy: [exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog exim/exim-src/src globals.c spool_in.c exim/exim-test-orig/AutoTest/confs 602 exim/exim-test-orig/AutoTest/log 574 602 exim/exim-test-orig/Au
ph10 2005/02/16 16:28:37 GMT

  Modified files:
    exim-doc/doc-txt     ChangeLog 
    exim-src/src         globals.c spool_in.c 
    exim-test-orig/AutoTest/log 574 
    exim-test-orig/AutoTest/mail 574.ph10 
    exim-test-orig/AutoTest/stderr 119 468 549 
    exim-test-orig/AutoTest/stdout 001 
  Added files:
    exim-test-orig/AutoTest/confs 602 
    exim-test-orig/AutoTest/log 602 
    exim-test-orig/AutoTest/mail 602.ph10 
    exim-test-orig/AutoTest/scripts 602 
    exim-test-orig/AutoTest/stderr 602 
    exim-test-orig/AutoTest/stdout 602 
  Log:
  Fix problems with the spool file that arise when the local username
  contains a space. Also, ensure that the Received: line item is
  appropriately quoted in this circumstance.


  Revision  Changes    Path
  1.80      +9 -0      exim/exim-doc/doc-txt/ChangeLog
  1.16      +1 -1      exim/exim-src/src/globals.c
  1.7       +16 -4     exim/exim-src/src/spool_in.c
  1.1       +35 -0     exim/exim-test-orig/AutoTest/confs/602 (new)
  1.2       +6 -6      exim/exim-test-orig/AutoTest/log/574
  1.1       +5 -0      exim/exim-test-orig/AutoTest/log/602 (new)
  1.2       +6 -6      exim/exim-test-orig/AutoTest/mail/574.ph10
  1.1       +10 -0     exim/exim-test-orig/AutoTest/mail/602.ph10 (new)
  1.1       +14 -0     exim/exim-test-orig/AutoTest/scripts/602 (new)
  1.3       +7 -3      exim/exim-test-orig/AutoTest/stderr/119
  1.3       +5 -3      exim/exim-test-orig/AutoTest/stderr/468
  1.4       +7 -3      exim/exim-test-orig/AutoTest/stderr/549
  1.1       +21 -0     exim/exim-test-orig/AutoTest/stderr/602 (new)
  1.6       +1 -1      exim/exim-test-orig/AutoTest/stdout/001
  1.1       +26 -0     exim/exim-test-orig/AutoTest/stdout/602 (new)


  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- ChangeLog    16 Feb 2005 15:24:21 -0000    1.79
  +++ ChangeLog    16 Feb 2005 16:28:36 -0000    1.80
  @@ -1,4 +1,4 @@
  -$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.79 2005/02/16 15:24:21 ph10 Exp $
  +$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.80 2005/02/16 16:28:36 ph10 Exp $


   Change log file for Exim from version 4.21
   -------------------------------------------
  @@ -374,6 +374,15 @@
       earlier. On busy systems, this bug wouldn't be noticed because something
       else would have woken the daemon, and it would have reaped the completed
       process earlier.
  +
  +80. If a message was submitted locally by a user whose login name contained one
  +    or more spaces (ugh!), the spool file that Exim wrote was not re-readable.
  +    It caused a spool format error. I have fixed the spool reading code. A
  +    related problem was that the "from" clause in the Received: line became
  +    illegal because of the space(s). It is now covered by ${quote_local_part.
  +
  +81. Included the latest eximstats from Steve (adds average sizes to HTML Top
  +    tables).



----------------------------------------------------

  Index: globals.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/globals.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- globals.c    25 Jan 2005 14:16:33 -0000    1.15
  +++ globals.c    16 Feb 2005 16:28:36 -0000    1.16
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/globals.c,v 1.15 2005/01/25 14:16:33 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/globals.c,v 1.16 2005/02/16 16:28:36 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -788,7 +788,7 @@
   uschar *received_header_text   = US
        "Received: "
        "${if def:sender_rcvhost {from $sender_rcvhost\n\t}"
  -     "{${if def:sender_ident {from $sender_ident }}"
  +     "{${if def:sender_ident {from ${quote_local_part:$sender_ident} }}"
        "${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}"
        "by $primary_hostname "
        "${if def:received_protocol {with $received_protocol}} "


  Index: spool_in.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/spool_in.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- spool_in.c    25 Jan 2005 14:16:33 -0000    1.6
  +++ spool_in.c    16 Feb 2005 16:28:36 -0000    1.7
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/spool_in.c,v 1.6 2005/01/25 14:16:33 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/spool_in.c,v 1.7 2005/02/16 16:28:36 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -230,7 +230,7 @@
   int rcount = 0;
   long int uid, gid;
   BOOL inheader = FALSE;
  -uschar originator[64];
  +uschar *p;


/* Reset all the global variables to their default values. However, there is
one exception. DO NOT change the default value of dont_deliver, because it may
@@ -325,9 +325,21 @@

if (Ufgets(big_buffer, big_buffer_size, f) == NULL) goto SPOOL_READ_ERROR;

-if (sscanf(CS big_buffer, "%s %ld %ld", originator, &uid, &gid) != 3)
- goto SPOOL_FORMAT_ERROR;
-originator_login = string_copy(originator);
+p = big_buffer + Ustrlen(big_buffer);
+while (p > big_buffer && isspace(p[-1])) p--;
+*p = 0;
+if (!isdigit(p[-1])) goto SPOOL_FORMAT_ERROR;
+while (p > big_buffer && isdigit(p[-1])) p--;
+gid = Uatoi(p);
+if (p <= big_buffer || *(--p) != ' ') goto SPOOL_FORMAT_ERROR;
+*p = 0;
+if (!isdigit(p[-1])) goto SPOOL_FORMAT_ERROR;
+while (p > big_buffer && isdigit(p[-1])) p--;
+uid = Uatoi(p);
+if (p <= big_buffer || *(--p) != ' ') goto SPOOL_FORMAT_ERROR;
+*p = 0;
+
+originator_login = string_copy(big_buffer);
originator_uid = (uid_t)uid;
originator_gid = (gid_t)gid;


Index: 602
====================================================================
# Exim test configuration 602

# Macros are set externally in order to get the path
# of the Exim that is being tested, and the directory
# in which the test data lives.

exim_path = EXIM_PATH
primary_hostname = myhost.test.ex
spool_directory = DIR/spool

# ----- Main settings -----

# This overrides, as we are in test harness
unknown_login = joe bloggs


# ----- Routers -----

begin routers

  r1:
    driver = accept
    transport = t1



# ----- Transports -----

begin transports

  t1:
    driver = appendfile
    file = DIR/test-mail/$local_part 
    user = CALLER 


# End

Index: 602
====================================================================
1999-03-02 09:44:33 10HmaX-0005vi-00 <= "joe bloggs"@??? U=joe bloggs P=local S=291
1999-03-02 09:44:33 Start queue run: pid=pppp
1999-03-02 09:44:33 10HmaX-0005vi-00 => ph10 <ph10@???> R=r1 T=t1
1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
1999-03-02 09:44:33 End queue run: pid=pppp

  Index: 574
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/log/574,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- 574    8 Oct 2004 14:49:31 -0000    1.1
  +++ 574    16 Feb 2005 16:28:36 -0000    1.2
  @@ -1,21 +1,21 @@
  -1999-03-02 09:44:33 10HmaX-0005vi-00 <= "abc@??? U=abc@xyz P=local S=275
  +1999-03-02 09:44:33 10HmaX-0005vi-00 <= "abc@??? U=abc@xyz P=local S=277
   1999-03-02 09:44:33 10HmaX-0005vi-00 => ph10 <ph10@???> R=r1 T=t1
   1999-03-02 09:44:33 10HmaX-0005vi-00 Completed
   1999-03-02 09:44:33 10HmaY-0005vi-00 <= a.b@??? U=a.b P=local S=265
   1999-03-02 09:44:33 10HmaY-0005vi-00 => ph10 <ph10@???> R=r1 T=t1
   1999-03-02 09:44:33 10HmaY-0005vi-00 Completed
  -1999-03-02 09:44:33 10HmaZ-0005vi-00 <= ".a.b"@??? U=.a.b P=local S=269
  +1999-03-02 09:44:33 10HmaZ-0005vi-00 <= ".a.b"@??? U=.a.b P=local S=271
   1999-03-02 09:44:33 10HmaZ-0005vi-00 => ph10 <ph10@???> R=r1 T=t1
   1999-03-02 09:44:33 10HmaZ-0005vi-00 Completed
  -1999-03-02 09:44:33 10HmbA-0005vi-00 <= "a.b."@??? U=a.b. P=local S=269
  +1999-03-02 09:44:33 10HmbA-0005vi-00 <= "a.b."@??? U=a.b. P=local S=271
   1999-03-02 09:44:33 10HmbA-0005vi-00 => ph10 <ph10@???> R=r1 T=t1
   1999-03-02 09:44:33 10HmbA-0005vi-00 Completed
  -1999-03-02 09:44:33 10HmbB-0005vi-00 <= "a\"b"@??? U=a"b P=local S=268
  +1999-03-02 09:44:33 10HmbB-0005vi-00 <= "a\"b"@??? U=a"b P=local S=271
   1999-03-02 09:44:33 10HmbB-0005vi-00 => ph10 <ph10@???> R=r1 T=t1
   1999-03-02 09:44:33 10HmbB-0005vi-00 Completed
  -1999-03-02 09:44:33 10HmbC-0005vi-00 <= "abc@??? U=abc@xyz P=local S=287
  +1999-03-02 09:44:33 10HmbC-0005vi-00 <= "abc@??? U=abc@xyz P=local S=289
   1999-03-02 09:44:33 10HmbC-0005vi-00 => ph10 <ph10@???> R=r1 T=t1
   1999-03-02 09:44:33 10HmbC-0005vi-00 Completed
  -1999-03-02 09:44:33 10HmbD-0005vi-00 <= "abc%xyz"@??? U=abc@xyz P=local S=275
  +1999-03-02 09:44:33 10HmbD-0005vi-00 <= "abc%xyz"@??? U=abc@xyz P=local S=277
   1999-03-02 09:44:33 10HmbD-0005vi-00 => ph10 <ph10@???> R=r1 T=t1
   1999-03-02 09:44:33 10HmbD-0005vi-00 Completed


  Index: 602.ph10
  ====================================================================
  From "joe bloggs"@??? Tue Mar 02 09:44:33 1999
  Received: from "joe bloggs" by myhost.test.ex with local (Exim x.yz)
      id 10HmaX-0005vi-00
      for ph10@???; Tue, 2 Mar 1999 09:44:33 +0000
  Message-Id: <E10HmaX-0005vi-00@???>
  From: Philip Hazel <"joe bloggs"@???>
  Date: Tue, 2 Mar 1999 09:44:33 +0000


Testing


  Index: 574.ph10
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/mail/574.ph10,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- 574.ph10    8 Oct 2004 14:49:42 -0000    1.1
  +++ 574.ph10    16 Feb 2005 16:28:37 -0000    1.2
  @@ -1,5 +1,5 @@
   From "abc@??? Tue Mar 02 09:44:33 1999
  -Received: from abc@xyz by myhost.test.ex with local (Exim x.yz)
  +Received: from "abc@xyz" by myhost.test.ex with local (Exim x.yz)
       id 10HmaX-0005vi-00
       for ph10@???; Tue, 2 Mar 1999 09:44:33 +0000
   Message-Id: <E10HmaX-0005vi-00@???>
  @@ -17,7 +17,7 @@



   From ".a.b"@??? Tue Mar 02 09:44:33 1999
  -Received: from .a.b by myhost.test.ex with local (Exim x.yz)
  +Received: from ".a.b" by myhost.test.ex with local (Exim x.yz)
       id 10HmaZ-0005vi-00
       for ph10@???; Tue, 2 Mar 1999 09:44:33 +0000
   Message-Id: <E10HmaZ-0005vi-00@???>
  @@ -26,7 +26,7 @@



   From "a.b."@??? Tue Mar 02 09:44:33 1999
  -Received: from a.b. by myhost.test.ex with local (Exim x.yz)
  +Received: from "a.b." by myhost.test.ex with local (Exim x.yz)
       id 10HmbA-0005vi-00
       for ph10@???; Tue, 2 Mar 1999 09:44:33 +0000
   Message-Id: <E10HmbA-0005vi-00@???>
  @@ -35,7 +35,7 @@



   From "a\"b"@??? Tue Mar 02 09:44:33 1999
  -Received: from a"b by myhost.test.ex with local (Exim x.yz)
  +Received: from "a\"b" by myhost.test.ex with local (Exim x.yz)
       id 10HmbB-0005vi-00
       for ph10@???; Tue, 2 Mar 1999 09:44:33 +0000
   Message-Id: <E10HmbB-0005vi-00@???>
  @@ -44,7 +44,7 @@



   From "abc@??? Tue Mar 02 09:44:33 1999
  -Received: from abc@xyz by myhost.test.ex with local (Exim x.yz)
  +Received: from "abc@xyz" by myhost.test.ex with local (Exim x.yz)
       id 10HmbC-0005vi-00
       for ph10@???; Tue, 2 Mar 1999 09:44:33 +0000
   From: x@y
  @@ -54,7 +54,7 @@



   From "abc%xyz"@??? Tue Mar 02 09:44:33 1999
  -Received: from abc@xyz by myhost.test.ex with local (Exim x.yz)
  +Received: from "abc@xyz" by myhost.test.ex with local (Exim x.yz)
       id 10HmbD-0005vi-00
       for ph10@???; Tue, 2 Mar 1999 09:44:33 +0000
   Message-Id: <E10HmbD-0005vi-00@???>


Index: 602
====================================================================
0 local user name containing space
exim -odq ph10
Testing
.
****
0
exim -d -bp
****
0
exim -Mvh $msg1
****
0
exim -q
****

  Index: 602
  ====================================================================
  Exim version x.yz uid=1169 gid=1169 pid=pppp D=fbb95cfd
  Lookups: lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz dnsdb dsearch ldap ldapdn ldapm mysql passwd pgsql testdb
  Fixed never_users: 0
  changed uid/gid: forcing real = effective
    uid=0 gid=1169 pid=pppp
    auxiliary group list: <none>
  configuration file is /source/exim4/AutoTest/confs/602
  log selectors = xxxxxxxx xxxxxxxx
  admin user
  changed uid/gid: privilege not needed
    uid=42 gid=42 pid=pppp
    auxiliary group list: <none>
  set_process_info: 21680 listing the queue
  reading spool file 10HmaX-0005vi-00-H
  user=joe bloggs uid=1169 gid=1169 sender="joe bloggs"@???
  sender_local=1 ident=joe bloggs
  Non-recipients:
  Empty Tree
  ---- End of tree ----
  recipients_count=1
  body_linecount=1 message_linecount=0


  Index: 119
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stderr/119,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- 119    17 Dec 2004 14:52:44 -0000    1.2
  +++ 119    16 Feb 2005 16:28:37 -0000    1.3
  @@ -3057,11 +3057,15 @@
   ---0 Rst    ** 32792
   ---0 Get   104
   ---0 Rst    ** 32792
  ----0 Get   424
  ----0 Get   384
  +---0 Get   440
  +---0 Get   408
   ---0 Rst    ** 32792
  +---0 Get   384
   ---0 Get   360
  ----0 Get   344
  +---0 Get   336
  +---0 Rst    ** 32792
  +---0 Get   104
  +---0 Rst    ** 32792
   ---0 Rst    ** 32792
   ---0 Get   296
   ---0 Rst    ** 32792


  Index: 468
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stderr/468,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- 468    19 Oct 2004 14:31:15 -0000    1.2
  +++ 468    16 Feb 2005 16:28:37 -0000    1.3
  @@ -45,7 +45,9 @@
   skipping: result is not used
   condition: def:sender_ident
      result: true
  -expanding: from $sender_ident 
  +expanding: $sender_ident
  +   result: ph10
  +expanding: from ${quote_local_part:$sender_ident} 
      result: from ph10 
   condition: def:sender_helo_name
      result: false
  @@ -54,7 +56,7 @@
      result: (helo=)

    
   skipping: result is not used
  -expanding: ${if def:sender_ident {from $sender_ident }}${if def:sender_helo_name {(helo=$sender_helo_name)
  +expanding: ${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)
       }}
      result: from ph10 
   condition: def:received_protocol
  @@ -76,7 +78,7 @@
       for 
   skipping: result is not used
   expanding: Received: ${if def:sender_rcvhost {from $sender_rcvhost
  -    }{${if def:sender_ident {from $sender_ident }}${if def:sender_helo_name {(helo=$sender_helo_name)
  +    }{${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)
       }}}}by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)
       }}(Exim $version_number)
       id $message_id${if def:received_for {


  Index: 549
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stderr/549,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- 549    21 Dec 2004 14:38:02 -0000    1.3
  +++ 549    16 Feb 2005 16:28:37 -0000    1.4
  @@ -29855,11 +29855,15 @@
   ---0 Rst    ** 32800
   ---0 Get   104
   ---0 Rst    ** 32800
  ----0 Get   424
  ----0 Get   384
  +---0 Get   440
  +---0 Get   408
   ---0 Rst    ** 32800
  +---0 Get   384
   ---0 Get   360
  ----0 Get   344
  +---0 Get   336
  +---0 Rst    ** 32800
  +---0 Get   104
  +---0 Rst    ** 32800
   ---0 Rst    ** 32800
   ---0 Get   296
   ---0 Rst    ** 32800


  Index: 602
  ====================================================================
   0m   291 10HmaX-0005vi-00 <"joe bloggs"@???>
            ph10@???


10HmaX-0005vi-00-H
joe bloggs 1169 1169
<"joe bloggs"@???>
ddddddddd 0
-ident joe bloggs
-received_protocol local
-body_linecount 1
-auth_id joe bloggs
-auth_sender joe bloggs@???
-allow_unqualified_recipient
-allow_unqualified_sender
-deliver_firsttime
-local
XX
1
ph10@???

  148P Received: from "joe bloggs" by myhost.test.ex with local (Exim x.yz)
      id 10HmaX-0005vi-00
      for ph10@???; Tue, 2 Mar 1999 09:44:33 +0000
  047I Message-Id: <E10HmaX-0005vi-00@???>
  049F From: Philip Hazel <"joe bloggs"@???>
  038  Date: Tue, 2 Mar 1999 09:44:33 +0000


  Index: 001
  ===================================================================
  RCS file: /home/cvs/exim/exim-test-orig/AutoTest/stdout/001,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- 001    4 Jan 2005 16:36:28 -0000    1.5
  +++ 001    16 Feb 2005 16:28:37 -0000    1.6
  @@ -125,7 +125,7 @@
   queue_run_max = 5
   queue_smtp_domains = 
   receive_timeout = 0s
  -received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}{${if def:sender_ident {from $sender_ident }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}(Exim $version_number)\n\tid $message_id${if def:received_for {\n\tfor $received_for}}
  +received_header_text = Received: ${if def:sender_rcvhost {from $sender_rcvhost\n\t}{${if def:sender_ident {from ${quote_local_part:$sender_ident} }}${if def:sender_helo_name {(helo=$sender_helo_name)\n\t}}}}by $primary_hostname ${if def:received_protocol {with $received_protocol}} ${if def:tls_cipher {($tls_cipher)\n\t}}(Exim $version_number)\n\tid $message_id${if def:received_for {\n\tfor $received_for}}
   received_headers_max = 30
   recipient_unqualified_hosts = 
   recipients_max = 0