[exim-cvs] Testsuite: headers_remove globbing. Bug 159

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Exim Git Commits Mailing List
Ημερομηνία:  
Προς: exim-cvs
Αντικείμενο: [exim-cvs] Testsuite: headers_remove globbing. Bug 159
Gitweb: https://git.exim.org/exim.git/commitdiff/6656a75a7b16170afdbbf4ac558f56f4e0ef75ac
Commit:     6656a75a7b16170afdbbf4ac558f56f4e0ef75ac
Parent:     258dfd012173250b20520c8fb24329eb8998970a
Author:     Jeremy Harris <jgh146exb@???>
AuthorDate: Mon Feb 3 15:30:43 2020 +0000
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Mon Feb 3 15:52:36 2020 +0000


    Testsuite: headers_remove globbing.  Bug 159
---
 doc/doc-docbook/spec.xfpt    | 24 ++++++++++++++++--------
 doc/doc-txt/NewStuff         |  4 ++++
 test/confs/0481              |  2 +-
 test/mail/0481.userx         |  1 +
 test/scripts/0000-Basic/0481 |  5 +++++
 5 files changed, 27 insertions(+), 9 deletions(-)


diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index aed9764..43199cf 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -18655,8 +18655,10 @@ This option specifies a list of text headers,
colon-separated (by default, changeable in the usual way &<<SECTlistsepchange>>&),
that is associated with any addresses that are accepted by the router.
However, the option has no effect when an address is just being verified.
-Each list item is separately expanded, at routing time.
-If an item ends in *, it will match any header with the same prefix.
+Each list item is separately expanded, at transport time.
+.new
+If an item ends in *, it will match any header with the given prefix.
+.wen
The way in which
the text is used to remove header lines at transport time is described in
section &<<SECTheadersaddrem>>&. Header lines are not actually removed until
@@ -18664,7 +18666,7 @@ the message is in the process of being transported. This means that references
to header lines in string expansions in the transport's configuration still
&"see"& the original header lines.

-The &%headers_remove%& option is expanded after &%errors_to%& and
+The &%headers_remove%& option is handled after &%errors_to%& and
&%headers_add%&, but before &%transport%&. If an item expansion is forced to fail,
the item has no effect. Other expansion failures are treated as configuration
errors.
@@ -21843,15 +21845,21 @@ checked, since this option does not automatically suppress them.
.option headers_remove transports list&!! unset
.cindex "header lines" "removing"
.cindex "transport" "header lines; removing"
-This option specifies a list of header names,
-colon-separated (by default, changeable in the usual way &<<SECTlistsepchange>>&);
-these headers are omitted from the message as it is transported, as described
-in section &<<SECTheadersaddrem>>&. Header removal can also be specified by
-routers.
+This option specifies a list of text headers,
+colon-separated (by default, changeable in the usual way &<<SECTlistsepchange>>&),
+to be removed from the message.
+However, the option has no effect when an address is just being verified.
Each list item is separately expanded.
If the result of the expansion is an empty string, or if the expansion
is forced to fail, no action is taken. Other expansion failures are treated as
errors and cause the delivery to be deferred.
+.new
+If an item ends in *, it will match any header with the given prefix.
+.wen
+
+Matching headers are omitted from the message as it is transported, as described
+in section &<<SECTheadersaddrem>>&. Header removal can also be specified by
+routers.

Unlike most options, &%headers_remove%& can be specified multiple times
for a transport; all listed headers are removed.
diff --git a/doc/doc-txt/NewStuff b/doc/doc-txt/NewStuff
index 3542c82..919a56e 100644
--- a/doc/doc-txt/NewStuff
+++ b/doc/doc-txt/NewStuff
@@ -35,6 +35,10 @@ Version 4.94

  9. The ACL control "queue_only" can also be spelled "queue", and now takes an
     option "first_pass_route" to do the same as a "-odqs" on the command line.
+ 9. Items specified for the router and transport headers_remove option can use
+    a trailing asterisk to specify globbing.
+
+



Version 4.93
diff --git a/test/confs/0481 b/test/confs/0481
index 09e3ed8..cdd6453 100644
--- a/test/confs/0481
+++ b/test/confs/0481
@@ -25,7 +25,7 @@ r2:

 r3:
   driver = accept
-  headers_remove = Remove-Me:
+  headers_remove = Remove-Me:X-Rem*
   headers_add = X-Was-Remove-Me: >$h_remove-me:<
   headers_add = ${if def:h_remove-me-also {X-Was-Remove-Me-Also: >$h_remove-me-also:<}}
   transport = t1
diff --git a/test/mail/0481.userx b/test/mail/0481.userx
index 07700dd..4af9fec 100644
--- a/test/mail/0481.userx
+++ b/test/mail/0481.userx
@@ -16,6 +16,7 @@ Received: from CALLER by myhost.test.ex with local (Exim x.yz)
     id 10HmaY-0005vi-00
     for userx@???; Tue, 2 Mar 1999 09:44:33 +0000
 Another: This is another header
+X-Ren-dont:    test globbing
 Message-Id: <E10HmaY-0005vi-00@???>
 From: CALLER_NAME <CALLER@???>
 Date: Tue, 2 Mar 1999 09:44:33 +0000
diff --git a/test/scripts/0000-Basic/0481 b/test/scripts/0000-Basic/0481
index be89249..08a5181 100644
--- a/test/scripts/0000-Basic/0481
+++ b/test/scripts/0000-Basic/0481
@@ -9,4 +9,9 @@ Another: This is another header
 Remove-Me-Also: me too!
 Remove-Me-Too: me too!
 Remove-Me-Too2: me too!
+X-Rem-1:    test globbing
+X-Rem-2:    test globbing
+X-Rem-foobar:    test globbing
+X-Rem:        test globbing
+X-Ren-dont:    test globbing
 ****