Re: [Exim] Re: LDAP attribute expansion question

Top Page
Delete this message
Reply to this message
Author: Tony Earnshaw
Date:  
To: Mark A. Hershberger
CC: exim-users
Subject: Re: [Exim] Re: LDAP attribute expansion question
Mark A. Hershberger wrote:

>>LDAP looks up entries where objectClass=posixAccount and uid=$local_part
>>agree and returns uid. For frigg, it returns "frigg, xizzy" and barfs (I
>>run 'exim -d+expand -bt', so I can see why it barfs).
>
> Do you want to get "frigg" where the $local_part is "frigg" and
> "xizzy" where the $local_part is "xizzy"? Then just replace {$value}
> with {$local_part}.


That was it :) I finally had time to sit down and actually try it and
see why, instead of doubting everybody but myself.

A thousand thanks, Mark.

> If you want "frigg" in both places (and, assuming that it is always
> the first returned), then surround your ${lookup ldap} with something
> like:
>
>     ${sg{${lookup...}{^([^,]+).*}{\$1}}}

>
> This is untested, though, so use care.


Goes into my Mozilla Exim HOWTO folder.

Thanks, Mark!

--Tonni

--
Tony Earnshaw

Millom kaksar eg litet kann trivast, millom jamningar helst er eg nøgd

http://www.billy.demon.nl
Mail: tonni@???