summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2007-06-29 09:20:37 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2007-06-29 09:20:37 +0000
commit1f5497b2a08c38975c9945122a0279bb03f99e28 (patch)
tree0e5a0c3de395a94111f87741d105cef86747be43
parentf53dbcfc62a395f3f3015a5b595ca538d537c2a5 (diff)
Fix stupid oversight in $max_received_linelength.
-rw-r--r--src/src/receive.c10
-rw-r--r--test/confs/05421
-rw-r--r--test/log/05421
-rwxr-xr-xtest/patchexim4
-rw-r--r--test/scripts/0000-Basic/054223
-rw-r--r--test/stdout/054220
6 files changed, 54 insertions, 5 deletions
diff --git a/src/src/receive.c b/src/src/receive.c
index ee95cc981..6d07e5c41 100644
--- a/src/src/receive.c
+++ b/src/src/receive.c
@@ -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;
diff --git a/test/confs/0542 b/test/confs/0542
index c3bd7e464..d22695158 100644
--- a/test/confs/0542
+++ b/test/confs/0542
@@ -11,6 +11,7 @@ gecos_name = CALLER_NAME
# ----- Main settings -----
+acl_smtp_rcpt = accept
queue_only
trusted_users = CALLER
diff --git a/test/log/0542 b/test/log/0542
index 88cb89769..1b66e81a6 100644
--- a/test/log/0542
+++ b/test/log/0542
@@ -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
diff --git a/test/patchexim b/test/patchexim
index c8fbe466b..8322961a7 100755
--- a/test/patchexim
+++ b/test/patchexim
@@ -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;
}
diff --git a/test/scripts/0000-Basic/0542 b/test/scripts/0000-Basic/0542
index 92f1f607e..6b14852b5 100644
--- a/test/scripts/0000-Basic/0542
+++ b/test/scripts/0000-Basic/0542
@@ -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>
diff --git a/test/stdout/0542 b/test/stdout/0542
index 3e42bc19d..a3cb9ef5f 100644
--- a/test/stdout/0542
+++ b/test/stdout/0542
@@ -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
+250 OK
+250 Accepted
+250 Accepted
+354 Enter message, ending with "." on a line by itself
+250 OK id=10HmaY-0005vi-00
+221 myhost.test.ex closing connection
+> 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 --------------------