[Exim] extract, address_data and ldap!

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Adam Cassar
Datum:  
To: exim-users
Betreff: [Exim] extract, address_data and ldap!
Hi Guys,

I am hoping someone can help me with a sticky configuration.

I am doing an ldap query and sticking it in address_data like so:

address_data = ${lookup
ldap{ldap:///uid=${quote_ldap:${local_part}}@${quote_ldap:${domain}},cn=${quote_ldap:${domain}},ou=webmail,dc=test,dc=com?base}{$value}{fail}

which returns me something like:

objectClass="top, inetLocalMailRecipient, posixAccount, person"
cn="pump" uid="pump@???" mail="pump@???"
mailLocalAddress="pump@???" userPassword="pump" uidNumber="10000"
gidNumber="10000" homeDirectory="/webmail/mail/t/e/test.com/pump/"
mailQuota="1000M"

Now what I want to do is use extract to get the data from the
objectClass field. However you will notice

objectClass="top, inetLocalMailRecipient, posixAccount, person"

But I want to check for ${extract{objectClass}{objectClass="top,
inetLocalMailRecipient, posixAccount, person"}}

Which obviously won't work. So I tried using ${sr to change ', ' to be
'objectClass=' so it ends up with multiple objectClass= variables.
However as there are multiple entries it always returns the first one -
but I want to check for the existence of lets say objectClass=person.

Any ideas?