[exim-dev] [Bug 2917] New: Return list of headers from perl …

Top Page
Delete this message
Reply to this message
Author: admin
Date:  
To: exim-dev
Subject: [exim-dev] [Bug 2917] New: Return list of headers from perl in transport
https://bugs.exim.org/show_bug.cgi?id=2917

            Bug ID: 2917
           Summary: Return list of headers from perl in transport
           Product: Exim
           Version: 4.95
          Hardware: x86-64
                OS: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Transports
          Assignee: unallocated@???
          Reporter: d.dimix.d@???
                CC: exim-dev@???


I came into a situation that possibly is buggy behavior.
There is transport that removes and adds headers generatPerly the perl script:
```
some_transport:
driver = smtp
...
headers_add = ${perl{get_headers_to_add}}
headers_remove = ${perl{get_headers_to_remove}}
```
- get_headers_to_add returns 'headerX: data\nheaderX2: data'
- get_headers_to_remove return a string like 'header1:header2:header3'

Data returned to headers_add acts normally and appends as many headers as
returned. 'headers_remove' instead works if only one header is returned, though
the returned string is a valid colon-separated list.

Consider the following:

14:20:47 1900121 ╭considering: ${perl{get_headers_to_remove}}
14:20:47 1900121 ╭considering: get_headers_to_remove}}
14:20:47 1900121 ├──expanding: get_headers_to_remove
14:20:47 1900121 ╰─────result: get_headers_to_remove
14:20:47 1900121 ├──expanding: ${perl{get_headers_to_remove}}
14:20:47 1900121 ╰─────result: header1:header2


'header1' and 'header2' must be removed, but actually, they are not. I tried
using ${map{${perl{func}}}{$item}} and ${filter{${perl{func}}}{$item}} as a
workaround, but no luck. However, when there is only one header removed from
the perl function, the returned header is removed as it should be.
I have hardcoded the required headers to be removed in the exim config, but
want to know if this is an expected behaviour of expansion.
P.S. Tested the returned string with "exim -be
'${listextract{1}{${perl{func}}}}'" - the returned string is interpreted as a
list and the valid index is returned.

--
You are receiving this mail because:
You are on the CC list for the bug.