summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2006-03-01 11:40:51 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2006-03-01 11:40:51 +0000
commitf90d018c03bbf7d8ac2cd50d33b47bdd7a4bcdf1 (patch)
tree24f409c10379bc09866ab8355196561057d03af7 /src
parentd35e429daf77293be8e2861de05c0f4312003737 (diff)
Add ${time_eval: expansion.
Diffstat (limited to 'src')
-rw-r--r--src/src/expand.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/src/expand.c b/src/src/expand.c
index c4932d58d..5d63cb191 100644
--- a/src/src/expand.c
+++ b/src/src/expand.c
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/src/src/expand.c,v 1.55 2006/02/28 14:54:54 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.56 2006/03/01 11:40:51 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
@@ -94,12 +94,14 @@ static uschar *op_table_underscore[] = {
US"from_utf8",
US"local_part",
US"quote_local_part",
+ US"time_eval",
US"time_interval"};
enum {
EOP_FROM_UTF8,
EOP_LOCAL_PART,
EOP_QUOTE_LOCAL_PART,
+ EOP_TIME_EVAL,
EOP_TIME_INTERVAL };
static uschar *op_table_main[] = {
@@ -4788,6 +4790,20 @@ while (*s != 0)
/* Handle time period formating */
+ case EOP_TIME_EVAL:
+ {
+ int n = readconf_readtime(sub, 0, FALSE);
+ if (n < 0)
+ {
+ expand_string_message = string_sprintf("string \"%s\" is not an "
+ "Exim time interval in \"%s\" operator", sub, name);
+ goto EXPAND_FAILED;
+ }
+ sprintf(CS var_buffer, "%d", n);
+ yield = string_cat(yield, &size, &ptr, var_buffer, Ustrlen(var_buffer));
+ continue;
+ }
+
case EOP_TIME_INTERVAL:
{
int n;