[Exim] Extracting arbitary field from LDAP return string

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

I've mulled over the new book and done the RTFM thing but am still not sure
if I
can do what I want to do.

I would like to extract an address from the results of an Active Directory
LDAP lookup.
The format of the returned string is: (line-wrapped for ease of transport)

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

Those familiar with Exchange and AD will probably recognise the
"proxyAddresses"
attribute output shown.

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...


that would perform my required task or is there another way (address_data?)
of achieving
my goal. I've attempted the use of things like "/SMTP:([^,])*/" but to no
avail.

The router I'm using is a basic :

ldap_lookup:
driver = redirect
data = ${lookup ldap {......

Hope you can help.

Martyn