Re: [Exim] Extracting arbitary field from LDAP return string

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Philip Hazel
Dátum:  
Címzett: Griffiths M (ISeLS)
CC: 'exim-users@exim.org'
Tárgy: Re: [Exim] Extracting arbitary field from LDAP return string
On Fri, 1 Aug 2003, Griffiths M (ISeLS) wrote:

> smtp:foo@???, SMTP:foo@???,
> X400:c=us;a= ;p=Prifysgol Morgan;o=Exchange;s=Bloggs;g=Fred;


> The field I need to extract (in this case) is the address found after the
> uppercase
> "SMTP:" i.e. foo@???
>
> I can extract the field in full, that is with the SMTP: attached, but no
> without.
>
> Is it possible to insert a regular expression into the standard:-
>
>    $extract{????}{${lookup ldap...

>


You don't need a regex; you just need to chop off the first 5
characters. Wrap the whole thing in ${substr:

${substr_5:${extract{...}{${lookup...}} ....



--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book