summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2007-08-23 11:01:49 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2007-08-23 11:01:49 +0000
commitddea74fabbf9135b146f96dd0a2a71a4b7100a86 (patch)
tree2694c992c53c2da94e5a95b81e33f71fa85d60ac /src
parentb7670459b9549ad6dcca2398580165e54b09b92d (diff)
Add message_body_newlines.
Diffstat (limited to 'src')
-rw-r--r--src/src/expand.c12
-rw-r--r--src/src/globals.c3
-rw-r--r--src/src/globals.h3
-rw-r--r--src/src/readconf.c3
4 files changed, 15 insertions, 6 deletions
diff --git a/src/src/expand.c b/src/src/expand.c
index be066a5a7..657d2b9f9 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/expand.c,v 1.89 2007/08/22 10:10:23 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.90 2007/08/23 11:01:49 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -1506,9 +1506,15 @@ while (last > first)
if (len > 0)
{
body[len] = 0;
- while (len > 0)
+ if (message_body_newlines) /* Separate loops for efficiency */
{
- if (body[--len] == '\n' || body[len] == 0) body[len] = ' ';
+ while (len > 0)
+ { if (body[--len] == 0) body[len] = ' '; }
+ }
+ else
+ {
+ while (len > 0)
+ { if (body[--len] == '\n' || body[len] == 0) body[len] = ' '; }
}
}
}
diff --git a/src/src/globals.c b/src/src/globals.c
index 55e9cbda4..74e87e6d3 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.c,v 1.77 2007/08/22 10:10:23 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.c,v 1.78 2007/08/23 11:01:49 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -754,6 +754,7 @@ int max_username_length = 0;
int message_age = 0;
uschar *message_body = NULL;
uschar *message_body_end = NULL;
+BOOL message_body_newlines = FALSE;
int message_body_size = 0;
int message_body_visible = 500;
int message_ended = END_NOTSTARTED;
diff --git a/src/src/globals.h b/src/src/globals.h
index 473b31125..5b9733c38 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/globals.h,v 1.58 2007/08/22 10:10:23 ph10 Exp $ */
+/* $Cambridge: exim/src/src/globals.h,v 1.59 2007/08/23 11:01:49 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -438,6 +438,7 @@ 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 */
extern uschar *message_body_end; /* End of message body for filter */
+extern BOOL message_body_newlines; /* FALSE => remove newlines */
extern int message_body_size; /* Sic */
extern int message_body_visible; /* Amount visible in message_body */
extern int message_ended; /* State of message reading and how ended */
diff --git a/src/src/readconf.c b/src/src/readconf.c
index 2ac260d8b..d44c1e839 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/readconf.c,v 1.32 2007/08/22 10:10:23 ph10 Exp $ */
+/* $Cambridge: exim/src/src/readconf.c,v 1.33 2007/08/23 11:01:49 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -265,6 +265,7 @@ static optionlist optionlist_config[] = {
{ "log_timezone", opt_bool, &log_timezone },
{ "lookup_open_max", opt_int, &lookup_open_max },
{ "max_username_length", opt_int, &max_username_length },
+ { "message_body_newlines", opt_bool, &message_body_newlines },
{ "message_body_visible", opt_mkint, &message_body_visible },
{ "message_id_header_domain", opt_stringptr, &message_id_domain },
{ "message_id_header_text", opt_stringptr, &message_id_text },