ph10 2006/03/01 11:40:51 GMT
Modified files:
exim-doc/doc-txt ChangeLog NewStuff
exim-src/src expand.c
exim-test/scripts/0000-Basic 0002
exim-test/stdout 0002
Log:
Add ${time_eval: expansion.
Revision Changes Path
1.319 +2 -0 exim/exim-doc/doc-txt/ChangeLog
1.93 +3 -0 exim/exim-doc/doc-txt/NewStuff
1.56 +16 -0 exim/exim-src/src/expand.c
1.4 +6 -0 exim/exim-test/scripts/0000-Basic/0002
1.4 +6 -0 exim/exim-test/stdout/0002
Index: ChangeLog
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
retrieving revision 1.318
retrieving revision 1.319
diff -u -r1.318 -r1.319
--- ChangeLog 1 Mar 2006 11:24:04 -0000 1.318
+++ ChangeLog 1 Mar 2006 11:40:51 -0000 1.319
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.318 2006/03/01 11:24:04 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.319 2006/03/01 11:40:51 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
@@ -251,6 +251,8 @@
of files (along with the size), even though it did not need this
information. It now does the scan only if it needs to find either the
size of the count of files.
+
+PH/51 Added ${time_eval: to convert Exim time strings into seconds.
Exim version 4.60
Index: NewStuff
===================================================================
RCS file: /home/cvs/exim/exim-doc/doc-txt/NewStuff,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -r1.92 -r1.93
--- NewStuff 28 Feb 2006 12:42:47 -0000 1.92
+++ NewStuff 1 Mar 2006 11:40:51 -0000 1.93
@@ -1,4 +1,4 @@
-$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.92 2006/02/28 12:42:47 ph10 Exp $
+$Cambridge: exim/exim-doc/doc-txt/NewStuff,v 1.93 2006/03/01 11:40:51 ph10 Exp $
New Features in Exim
--------------------
@@ -101,6 +101,9 @@
PH/15 The smtp transport has a new option called authenticated_sender_force.
When set true, it allows the authenticated_sender option's value to be
used, even if Exim has not authenticated as a client.
+
+PH/16 The expansion ${time_eval:<string>} converts an Exim time string such as
+ 2d4h1m into a number of seconds.
Version 4.60
Index: expand.c
===================================================================
RCS file: /home/cvs/exim/exim-src/src/expand.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- expand.c 28 Feb 2006 14:54:54 -0000 1.55
+++ expand.c 1 Mar 2006 11:40:51 -0000 1.56
@@ -1,4 +1,4 @@
-/* $Cambridge: exim/exim-src/src/expand.c,v 1.55 2006/02/28 14:54:54 ph10 Exp $ */
+/* $Cambridge: exim/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 @@
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[] = {
@@ -4787,6 +4789,20 @@
}
/* 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:
{
Index: 0002
===================================================================
RCS file: /home/cvs/exim/exim-test/scripts/0000-Basic/0002,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- 0002 13 Feb 2006 11:13:37 -0000 1.3
+++ 0002 1 Mar 2006 11:40:51 -0000 1.4
@@ -142,6 +142,12 @@
strlen: ${strlen:}
strlen: ${strlen:a}
strlen: ${strlen:abcdefgh}
+time_eval: ${time_eval:10s}
+time_eval: ${time_eval:2h}
+time_eval: ${time_eval:1d5m}
+time_eval: ${time_eval:1w2d3h4m5s}
+time_eval: ${time_eval:14}
+time_eval: ${time_eval:rhubarb}
time_interval: ${time_interval:0}
time_interval: ${time_interval:44}
time_interval: ${time_interval:999999}
Index: 0002
===================================================================
RCS file: /home/cvs/exim/exim-test/stdout/0002,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- 0002 13 Feb 2006 11:13:37 -0000 1.3
+++ 0002 1 Mar 2006 11:40:51 -0000 1.4
@@ -123,6 +123,12 @@
> strlen: 0
> strlen: 1
> strlen: 8
+> time_eval: 10
+> time_eval: 7200
+> time_eval: 86700
+> time_eval: 788645
+> Failed: string "14" is not an Exim time interval in "time_eval" operator
+> Failed: string "rhubarb" is not an Exim time interval in "time_eval" operator
> time_interval: 0s
> time_interval: 44s
> time_interval: 1w4d13h46m39s