Συντάκτης: Jeremy Harris Ημερομηνία: Προς: exim-users Αντικείμενο: Re: [exim] Handling double commas in LDAP lookup results
On 26/08/14 18:18, Marten Lehmann wrote: >> You need to use ${sg} to replace ,, with ,:
>>
>> text = ${sg{${lookup ldap
>> {ldap:///cn=$local_part@$domain,ou=users,dc=mail?autoresponder}}{,,}{,}}
>
> this is our poor man's workaround already. Yet, I don't understand the
> situation, where double commas are needed. What was broken so double
> commas seemed like a solution?
The exim ldap lookup returns a comma-separated list of values for each
attribute returned. For consistency this is so even for an attribute
having only one value. Exim's standard list-parsing facilities handle
list items which contain the list separator by doubling any such.
The change was made so that it was possible to unambiguously parse
these; it was previously not.
An alternative to the "sg" above for extracting the list value would
be to use (from 4.83 onwards) ${listextract {1}{the_complete_list}}.
For either "sg" or "listextract" you might prefer the style