-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.516 2007/06/20 14:13:39 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.517 2007/06/22 14:38:58 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
PH/10 Added the /noupdate option to the ratelimit ACL condition.
+PH/11 Added $max_received_linelength.
+
Exim version 4.67
-----------------
-$Cambridge: exim/doc/doc-txt/NewStuff,v 1.151 2007/06/20 14:13:39 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/NewStuff,v 1.152 2007/06/22 14:38:58 ph10 Exp $
New Features in Exim
--------------------
accept
+ 6. The variable $max_received_linelength contains the number of bytes in the
+ longest line that was received as part of the message, not counting the
+ line termination character(s).
+
Version 4.67
------------
-/* $Cambridge: exim/src/exim_monitor/em_globals.c,v 1.11 2007/01/08 10:50:17 ph10 Exp $ */
+/* $Cambridge: exim/src/exim_monitor/em_globals.c,v 1.12 2007/06/22 14:38:58 ph10 Exp $ */
/*************************************************
* Exim Monitor *
uschar *spam_score_int = NULL;
#endif
+int max_received_linelength= 0;
int message_age = 0;
uschar *message_id;
uschar *message_id_external;
-/* $Cambridge: exim/src/src/expand.c,v 1.86 2007/06/14 14:18:19 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.87 2007/06/22 14:38:58 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
#ifdef WITH_CONTENT_SCAN
{ "malware_name", vtype_stringptr, &malware_name },
#endif
+ { "max_received_linelength", vtype_int, &max_received_linelength },
{ "message_age", vtype_int, &message_age },
{ "message_body", vtype_msgbody, &message_body },
{ "message_body_end", vtype_msgbody_end, &message_body_end },
-/* $Cambridge: exim/src/src/globals.c,v 1.74 2007/06/18 13:57:50 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.c,v 1.75 2007/06/22 14:38:58 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
#ifdef WITH_CONTENT_SCAN
uschar *malware_name = NULL; /* Virus Name */
#endif
+int max_received_linelength= 0;
int max_username_length = 0;
int message_age = 0;
uschar *message_body = NULL;
-/* $Cambridge: exim/src/src/globals.h,v 1.54 2007/06/14 14:18:19 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.h,v 1.55 2007/06/22 14:38:58 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
#ifdef WITH_CONTENT_SCAN
extern uschar *malware_name; /* Name of virus or malware ("W32/Klez-H") */
#endif
+extern int max_received_linelength;/* What it says */
extern int max_username_length; /* For systems with broken getpwnam() */
extern int message_age; /* In seconds */
extern uschar *message_body; /* Start of message body for filter */
-/* $Cambridge: exim/src/src/receive.c,v 1.37 2007/04/16 10:31:58 ph10 Exp $ */
+/* $Cambridge: exim/src/src/receive.c,v 1.38 2007/06/22 14:38:58 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
{
int ch_state;
register int ch;
+register int linelength = 0;
/* Handle the case when only EOF terminates the message */
if (ch == 0) body_zerocount++;
if (last_ch == '\r' && ch != '\n')
{
+ if (linelength > max_received_linelength)
+ max_received_linelength = linelength;
+ linelength = 0;
if (fputc('\n', fout) == EOF) return END_WERROR;
message_size++;
body_linecount++;
if (ch == '\r') continue;
if (fputc(ch, fout) == EOF) return END_WERROR;
- if (ch == '\n') body_linecount++;
+ if (ch == '\n')
+ {
+ if (linelength > max_received_linelength)
+ max_received_linelength = linelength;
+ linelength = 0;
+ body_linecount++;
+ }
+ else linelength++;
if (++message_size > thismessage_size_limit) return END_SIZE;
}
if (last_ch != '\n')
{
+ if (linelength > max_received_linelength)
+ max_received_linelength = linelength;
if (fputc('\n', fout) == EOF) return END_WERROR;
message_size++;
body_linecount++;
{
case 0: /* Normal state (previous char written) */
if (ch == '\n')
- { body_linecount++; ch_state = 1; }
+ {
+ body_linecount++;
+ if (linelength > max_received_linelength)
+ max_received_linelength = linelength;
+ linelength = -1;
+ ch_state = 1;
+ }
else if (ch == '\r')
{ ch_state = 2; continue; }
break;
case 1: /* After written "\n" */
if (ch == '.') { ch_state = 3; continue; }
- if (ch != '\n') ch_state = 0;
+ if (ch != '\n') ch_state = 0; else linelength = -1;
break;
case 2:
body_linecount++; /* After unwritten "\r" */
+ if (linelength > max_received_linelength)
+ max_received_linelength = linelength;
if (ch == '\n')
- { ch_state = 1; }
+ {
+ ch_state = 1;
+ linelength = -1;
+ }
else
{
if (message_size++, fputc('\n', fout) == EOF) return END_WERROR;
if (ch == '\r') continue;
ch_state = 0;
+ linelength = 0;
}
break;
if (ch == '\n') return END_DOT;
if (ch == '\r') { ch_state = 4; continue; }
message_size++;
+ linelength++;
if (fputc('.', fout) == EOF) return END_WERROR;
ch_state = 0;
break;
break;
}
+ linelength++;
if (fputc(ch, fout) == EOF) return END_WERROR;
if (++message_size > thismessage_size_limit) return END_SIZE;
}
int start, end, domain, size, sptr;
int id_resolution;
int had_zero = 0;
+int prevlines_length = 0;
register int ptr = 0;
spool_name[0] = 0;
message_size = 0;
warning_count = 0;
-received_count = 1; /* For the one we will add */
+received_count = 1; /* For the one we will add */
if (thismessage_size_limit <= 0) thismessage_size_limit = INT_MAX;
/* While reading the message, the following counts are computed. */
-message_linecount = body_linecount = body_zerocount = 0;
+message_linecount = body_linecount = body_zerocount =
+ max_received_linelength = 0;
#ifdef EXPERIMENTAL_DOMAINKEYS
/* Call into DK to set up the context. Check if DK is to be run are carried out
receive_linecount++;
message_linecount++;
+ /* Keep track of maximum line length */
+
+ if (ptr - prevlines_length > max_received_linelength)
+ max_received_linelength = ptr - prevlines_length;
+ prevlines_length = ptr + 1;
+
/* Now put in the terminating newline. There is always space for
at least two more characters. */
next->text = store_get(header_size);
ptr = 0;
had_zero = 0;
+ prevlines_length = 0;
} /* Continue, starting to read the next header */
/* At this point, we have read all the headers into a data structure in main
-/* $Cambridge: exim/src/src/spool_in.c,v 1.19 2007/01/08 10:50:18 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_in.c,v 1.20 2007/06/22 14:38:58 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
interface_port = 0;
local_error_message = FALSE;
local_scan_data = NULL;
+max_received_linelength = 0;
message_linecount = 0;
received_protocol = NULL;
received_count = 0;
case 'm':
if (Ustrcmp(p, "anual_thaw") == 0) deliver_manual_thaw = TRUE;
+ else if (Ustrncmp(p, "ax_received_linelength", 22) == 0)
+ max_received_linelength = Uatoi(big_buffer + 24);
break;
case 'N':
-/* $Cambridge: exim/src/src/spool_out.c,v 1.13 2007/01/22 16:29:54 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_out.c,v 1.14 2007/06/22 14:38:58 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Now any other data that needs to be remembered. */
fprintf(f, "-body_linecount %d\n", body_linecount);
+fprintf(f, "-max_received_linelength %d\n", max_received_linelength);
if (body_zerocount > 0) fprintf(f, "-body_zerocount %d\n", body_zerocount);
To: Yourself <you@here.tld>
Subject: The subject is not the object
-This is the body of the message.
+This is the body of the message. Make the line longer than any header.
****
sudo exim -be -Mset $msg1
From: $h_from:
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
message_exim_id=$message_exim_id
message_linecount=$message_linecount
message_body_linecount=$body_linecount
+max_received_linelength=$max_received_linelength
headers -----------------
$message_headers
-interface_address 127.0.0.1.1225
-received_protocol esmtp
-body_linecount 0
+-max_received_linelength 0
-deliver_firsttime
XX
1
-interface_address 127.0.0.1.1225
-received_protocol esmtp
-body_linecount 0
+-max_received_linelength 0
-deliver_firsttime
XX
1
-interface_address 127.0.0.1.1225
-received_protocol esmtp
-body_linecount 0
+-max_received_linelength 0
-deliver_firsttime
XX
1
-interface_address 127.0.0.1.1225
-received_protocol esmtp
-body_linecount 0
+-max_received_linelength 25
-deliver_firsttime
XX
1
-interface_address 127.0.0.1.1225
-received_protocol esmtp
-body_linecount 0
+-max_received_linelength 25
-deliver_firsttime
XX
1
-interface_address 127.0.0.1.1225
-received_protocol esmtp
-body_linecount 0
+-max_received_linelength 25
-deliver_firsttime
XX
1
-interface_address 127.0.0.1.1225
-received_protocol esmtp
-body_linecount 0
+-max_received_linelength 25
-deliver_firsttime
XX
1
-ident CALLER
-received_protocol local
-body_linecount 1
+-max_received_linelength 25
-auth_id CALLER
-auth_sender CALLER@myhost.test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 19
-auth_id CALLER
-auth_sender CALLER@test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 19
-auth_id CALLER
-auth_sender CALLER@test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 0
-auth_id CALLER
-auth_sender CALLER@test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 32
-auth_id CALLER
-auth_sender CALLER@myhost.test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 14
-auth_id CALLER
-auth_sender CALLER@myhost.test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 18
-auth_id CALLER
-auth_sender CALLER@myhost.test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 46
-auth_id CALLER
-auth_sender CALLER@myhost.test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 46
-auth_id CALLER
-auth_sender CALLER@myhost.test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 0
-auth_id CALLER
-auth_sender CALLER@test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 0
-auth_id CALLER
-auth_sender CALLER@myhost.test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 0
-auth_id CALLER
-auth_sender CALLER@myhost.test.ex
-allow_unqualified_recipient
-ident CALLER
-received_protocol local
-body_linecount 0
+-max_received_linelength 0
-auth_id CALLER
-auth_sender CALLER@myhost.test.ex
-allow_unqualified_recipient
-aclm 0 22
>Sender verify failed<
-body_linecount 0
+-max_received_linelength 0
-auth_id CALLER
-allow_unqualified_recipient
-allow_unqualified_sender
-ident CALLER
-received_protocol local-smtp
-body_linecount 0
+-max_received_linelength 0
-auth_id CALLER
-allow_unqualified_recipient
-allow_unqualified_sender
-ident CALLER
-received_protocol local-smtp
-body_linecount 2
+-max_received_linelength 6
-auth_id CALLER
-allow_unqualified_recipient
-allow_unqualified_sender
-ident spaced user
-received_protocol local
-body_linecount 1
+-max_received_linelength 7
-auth_id spaced user
-auth_sender spaced user@myhost.test.ex
-allow_unqualified_recipient
> From: Himself <himself@there.tld>
> Subject: The subject is not the object
-> message_body_size=33
-> message_size=369
+> message_body_size=71
+> message_size=407
> message_id=10HmaX-0005vi-00
> message_exim_id=10HmaX-0005vi-00
+> max_received_linelength=70
> recipients=userx@test.x, usery@test.ex
>
> from: A Person <a.person@a.domain.tld>
> message_exim_id=10HmaY-0005vi-00
> message_linecount=6
> message_body_linecount=2
+> max_received_linelength=50
> headers -----------------
> From: A Person <a.person@a.domain.tld>
To: First <first@test.ex>, Second <second@test.ex>
-interface_address 127.0.0.1.1225
-received_protocol esmtpa
-body_linecount 0
+-max_received_linelength 0
-auth_id username
-deliver_firsttime
XX
-interface_address 127.0.0.1.1225
-received_protocol esmtpa
-body_linecount 0
+-max_received_linelength 0
-auth_id username
-deliver_firsttime
XX
-interface_address 127.0.0.1.1225
-received_protocol esmtpa
-body_linecount 0
+-max_received_linelength 0
-auth_id username
-deliver_firsttime
XX
-interface_address 127.0.0.1.1225
-received_protocol esmtpa
-body_linecount 0
+-max_received_linelength 0
-auth_id username@auth.id.domain
-deliver_firsttime
XX
-interface_address 127.0.0.1.1225
-received_protocol esmtpa
-body_linecount 0
+-max_received_linelength 15
-auth_id username@auth.id.domain
-deliver_firsttime
XX