Dumping Postfix ldap tables to hash files

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Dumping Postfix ldap tables to hash files

Ganael Laplanche
Hello everyone,

I was looking for some way of having hash file fallbacks for our ldap lookup
tables.

As 'postmap -s' does not work (yet ?) for ldap-backed tables, I've written a
small script that uses a ldap_table(5) .cf file as input and outputs a hash
table that (hopefully!) includes all elements that could be retrieved by the
initial ldap search. I've attached the script to this mail as it may be of
interest to some of you too.

This is not perfect as only a subset of ldap_table(5) options are handled, but
it fits our needs. It uses plain sh and has only dependencies to the (great)
Miller tool available here:

https://github.com/johnkerl/miller

as well as OpenLDAP client tools (ldapsearch to be precise).

Any comment is welcome!
Best regards,

--
Ganael Laplanche <[hidden email]>
Unix Systems Engineer @CentraleSupelec Rennes

postfix-ldap2hash.sh (9K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dumping Postfix ldap tables to hash files

Wietse Venema
Ganael Laplanche:
> Hello everyone,
>
> I was looking for some way of having hash file fallbacks for our ldap lookup
> tables.

Alternative: use memcache (on 127.0.0.1) with LDAP as a 'backup'.
This will answer most queries from the cache.

        Wietse
Reply | Threaded
Open this post in threaded view
|

Re: Dumping Postfix ldap tables to hash files

Ganael Laplanche
On Wednesday, December 16, 2020 4:58:28 PM CET Wietse Venema wrote:

Hello Wietse,

> Alternative: use memcache (on 127.0.0.1) with LDAP as a 'backup'.
> This will answer most queries from the cache.

Thanks for your reply.

It seems interesting, I'll have a look at that.

Best regards,

--
Ganael Laplanche <[hidden email]>
Unix Systems Engineer @CentraleSupelec Rennes