[exim] LDAP lookup inside 'central' filter

Startseite
Nachricht löschen
Nachricht beantworten
Autor: ashkan
Datum:  
To: Exim-users
CC: 
Betreff: [exim] LDAP lookup inside 'central' filter
Hey all

Does anyone know if its possible to do LDAP lookups directly in a system_filter or similar (such as a central_filter using the redirect transport)? Basically, I want to lookup the OU for a particular mail user and then perform selective filtering based on what 'organizational unit' that particular mail user is in, system wide.

For example, I've setup a system-wide central filter as follows:

>central_filter:
> driver = redirect
> domains = +local_domains
> file = /etc/exim/filter1
> no_verify
> user = exim
> group = exim
> allow_filter
> allow_freeze


Then I want to have something like the following inside /etc/exim/filter1

>group = ${lookup ldapm {ldap://localhost:389/ou=people,dc=testdomain,dc=com?ou?(mail=${local_­part})}{$value}
>
>if $group is "marketing" then save /dev/null endif


Does anyone know how to do this or if its possible? I found this post: http://www.exim.org/mail-archives/exim-users/Week-of-Mon-20030310/msg00292.html but no further information on the matter.

Perhaps I can lookup the group information outside of the central_filter, then pass that information to the filtering script?

Also, I understand theres some caveats between system_filters and central_filters with regards to multiple recipients which is why I chose to use the redirect/central_filter model. Are there any problems with this approach?

-a