[Exim] LDAP attribute expansion question

Top Page
Delete this message
Reply to this message
Author: Tony Earnshaw
Date:  
To: exim-users
Subject: [Exim] LDAP attribute expansion question
LDAP people,

Exim 4.22, Openldap 2.1.22.

I have an LDAP based local_parts (Posix account-based) router. It works
well. I use it to avoid having to accept mail to /etc/passwd uids, all
mail goes to LDAP-based user uids.

The only thing that doesn't work, is users with the rDNs such as the
following:

dn: cn=frigg+uid=xizzy,ou=people,ou=groups,dc=billy,dc=demon,dc=nl

This is a perfectly valid DN, as far as LDAP is concerned, but frigg
gets 2 uids: frigg, xizzy.

Exim turns up 2 uids for frigg (perfectly correctly, Postfix 2.0 does
the same), but Exim doesn't know what to do with them - Postfix does and
accepts either :-(

My router is:

localuser:
  driver                = accept
  cannot_route_message  = Unknown user
  local_parts   = ${lookup ldapm \
   {user="cn=exim,ou=services,ou=groups,dc=billy,dc=demon,dc=nl
pass=wibblywobbly \
   ldaps://localhost/\
   dc=billy,dc=demon,dc=nl?uid?sub?\
   (&(objectClass=posixAccount)(uid=$local_part))\
   }\
   {$value} fail }
   transport            = local_delivery


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

What I need to do, is to get the "frigg" part out and pass this on to
the router. I've tried substr, sg and other things, but they don't
expand 'uid'.

Anybody any ideas?

--Tonni

--
Tony Earnshaw

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

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