Fix stupid oversight in $max_received_linelength.
authorPhilip Hazel <ph10@hermes.cam.ac.uk>
Fri, 29 Jun 2007 09:20:37 +0000 (09:20 +0000)
committerPhilip Hazel <ph10@hermes.cam.ac.uk>
Fri, 29 Jun 2007 09:20:37 +0000 (09:20 +0000)
src/src/receive.c
test/confs/0542
test/log/0542
test/patchexim
test/scripts/0000-Basic/0542
test/stdout/0542

index ee95cc98120aea90b184c9a9bc76a52bb6ca2748..6d07e5c414c892b98ce68bfb79342864696b99f6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/receive.c,v 1.38 2007/06/22 14:38:58 ph10 Exp $ */
+/* $Cambridge: exim/src/src/receive.c,v 1.39 2007/06/29 09:20:37 ph10 Exp $ */
 
 /*************************************************
 *     Exim - an Internet mail transport agent    *
@@ -728,6 +728,7 @@ read_message_data_smtp(FILE *fout)
 {
 int ch_state = 0;
 register int ch;
+register int linelength = 0;
 
 while ((ch = (RECEIVE_GETC)()) != EOF)
   {
@@ -749,6 +750,9 @@ while ((ch = (RECEIVE_GETC)()) != EOF)
       {
       ch_state = 0;
       body_linecount++;
+      if (linelength > max_received_linelength)
+        max_received_linelength = linelength;
+      linelength = -1;
       }
     else if (ch == '\r')
       {
@@ -759,6 +763,9 @@ while ((ch = (RECEIVE_GETC)()) != EOF)
 
     case 2:                             /* After (unwritten) CR */
     body_linecount++;
+    if (linelength > max_received_linelength)
+      max_received_linelength = linelength;
+    linelength = -1;
     if (ch == '\n')
       {
       ch_state = 0;
@@ -800,6 +807,7 @@ while ((ch = (RECEIVE_GETC)()) != EOF)
   next. */
 
   message_size++;
+  linelength++;
   if (fout != NULL)
     {
     if (fputc(ch, fout) == EOF) return END_WERROR;
index c3bd7e464821a219719b180e91fe740c7b2069f9..d226951584aa6b025f6b3b17ce0aca40cb46f84f 100644 (file)
@@ -11,6 +11,7 @@ gecos_name = CALLER_NAME
 
 # ----- Main settings -----
 
+acl_smtp_rcpt = accept
 queue_only
 trusted_users = CALLER
 
index 88cb897692a05707029ab2d40b332fb47afd0b5f..1b66e81a6de5a5d2fc37e52140cbf3e7d85e0e60 100644 (file)
@@ -1 +1,2 @@
 1999-03-02 09:44:33 10HmaX-0005vi-00 <= userz@test.ex U=userz P=local S=sss
+1999-03-02 09:44:33 10HmaY-0005vi-00 <= userz@test.ex U=CALLER P=local-smtp S=sss
index c8fbe466bf2fb889ff4b4bfb2c18a07bbadeeb14..8322961a7c6e6aededeccecf8c4bdd6e00ba9952 100755 (executable)
@@ -1,6 +1,6 @@
 #! /usr/bin/perl -w
 
-# $Cambridge: exim/test/patchexim,v 1.1 2006/02/06 16:07:10 ph10 Exp $
+# $Cambridge: exim/test/patchexim,v 1.2 2007/06/29 09:20:37 ph10 Exp $
 
 ###############################################################################
 # This is an auxiliary script that is part of the Exim test suite. It must be #
@@ -18,7 +18,7 @@ open(OUT, ">eximdir/exim") || die "** Failed to open eximdir/exim: $!\n";
 while(<IN>)
   {
   s/>>>running<<</<<<testing>>>/;
-  s/(\d+\.\d+(?:\.\d+)?(-RC\d+)?\0<<eximversion>>)/"x.yz\0" . ("*" x (length($1) - 5))/e;
+  s/(\d+\.\d+(?:\.\d+)?(-RC\d+|-dev)?\0<<eximversion>>)/"x.yz\0" . ("*" x (length($1) - 5))/e;
   print OUT;
   }
 
index 92f1f607e6a1ec9d4e7e297ff0b2c28b97bd4a74..6b14852b58898bef89077b87179765714ecafe44 100644 (file)
@@ -16,6 +16,29 @@ message_exim_id=$message_exim_id
 max_received_linelength=$max_received_linelength
 recipients=$recipients
 ****
+exim -bs
+mail from:<userz@test.ex>
+rcpt to:<userx@test.x>
+rcpt to:<usery@test.ex>
+data
+From: Himself <himself@there.tld>
+To: Yourself <you@here.tld>
+Subject: The subject is not the object
+
+This is the body of the message. Make the line much longer than any header.
+.
+quit
+****
+sudo exim -be -Mset $msg2
+From: $h_from:
+Subject: $h_subject:
+message_body_size=$message_body_size
+message_size=$message_size
+message_id=$message_id
+message_exim_id=$message_exim_id
+max_received_linelength=$max_received_linelength
+recipients=$recipients
+****
 write test-data
 From: A Person <a.person@a.domain.tld>
 To: First <first@test.ex>, Second <second@test.ex>
index 3e42bc19dfee4eed582cef351dcea8fc99c81180..a3cb9ef5fc69a600a645a8ad8842c30e5eebb0c3 100644 (file)
@@ -7,12 +7,28 @@
 > max_received_linelength=70
 > recipients=userx@test.x, usery@test.ex
 > 
+220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000\r
+250 OK\r
+250 Accepted\r
+250 Accepted\r
+354 Enter message, ending with "." on a line by itself\r
+250 OK id=10HmaY-0005vi-00\r
+221 myhost.test.ex closing connection\r
+> From: Himself <himself@there.tld>
+> Subject: The subject is not the object
+> message_body_size=76
+> message_size=416
+> message_id=10HmaY-0005vi-00
+> message_exim_id=10HmaY-0005vi-00
+> max_received_linelength=75
+> recipients=userx@test.x, usery@test.ex
+> 
 > from: A Person <a.person@a.domain.tld>
 > to: First <first@test.ex>, Second <second@test.ex>
 > subject: The subject is moot
 > message_size=197
 > message_body_size=77
-> message_exim_id=10HmaY-0005vi-00
+> message_exim_id=10HmaZ-0005vi-00
 > message_linecount=6
 > message_body_linecount=2
 > max_received_linelength=50
@@ -20,7 +36,7 @@
 > From: A Person <a.person@a.domain.tld>
 To: First <first@test.ex>, Second <second@test.ex>
 Subject: The subject is moot
-Message-Id: <E10HmaY-0005vi-00@myhost.test.ex>
+Message-Id: <E10HmaZ-0005vi-00@myhost.test.ex>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
 > 
 > body --------------------