Re: [exim] "${strlen" is not a known operator ...

Góra strony
Delete this message
Reply to this message
Autor: Jeremy Harris
Data:  
Dla: exim-users
Temat: Re: [exim] "${strlen" is not a known operator ...
On 17/03/16 14:32, Ian Eiloart wrote:
>
>> On 16 Mar 2016, at 18:44, Jeremy Harris <jgh@???> wrote:
>>
>> On 16/03/16 18:23, Ian Eiloart wrote:
>>> I have these lines in a router (they’re designed to mitigate the "reply-all" problem after someone spams the entire campus):
>>>
>>>    headers_remove = \
>>>        Bcc \
>>>        ${if  > { ${strlen:$header_To: } } {4096}  { : To }}\
>>>        ${if  > { ${strlen:$header_Cc: } } {4096} { : Cc }}

>>
>>
>>> "failed to expand headers_add or headers_remove: "${strlen" is not a known operator (or a } is missing in a variable reference)"
>>
>> http://exim.org/exim-html-current/doc/html/spec_html/ch-generic_options_for_routers.html
>>
>> "Warning 3: Because of the separate expansion of the list items, items
>> that contain a list separator must have it doubled. To avoid this,
>> change the list separator (6.20). "
>
> Thanks, that’s a useful caution. But after expansion, it should look like this (assuming both headers are very long):
>
> headers_remove = \
>     Bcc \
>     : To \
>     : Cc

>
> So the list separator isn’t the issue.


Beg to differ. According to that warning:
The original will get split into list items on the
colons that follow the "strlen" _first_. Only then is the
string-expansion done, and "${strlen" lacking colon and closing-}
just isn't good syntax.

You could have the buffer-length bug also, of course.
--
Jeremy