Timo Veith:
> ldap_table(5) says that a ldap table file has the same format as main.cf.
> 
> Can I just put
> 
> server_host
> search_base =
> bind =
> bind_dn =
> bind_pw =
> version =
> ..
> 
> in main.cf and leave the other parameters in the files mentioned above?

Nope, the format for main.cf parameters requires that
you prefix those parameters with the table name.

This is better solved with the "make" program.

/etc/postfix/ldap/users.proto
        stuff...

/etc/postfix/ldap/aliases.proto
        stuff...

/etc/postfix/ldap/groups.proto
        stuff...

/etc/postfix/ldap/credentials
    server_host = ...
    bind =
    bind_dn =
    bind_pw =
    version =
    ..

/etc/postfix/ldap/Makefile:
    .SUFFIXES: .proto
    .proto:; cat $*.proto credentials >$*.tmp && mv $*.tmp $*
    # Note: whitespace after "all:" must be a TAB.
    all:        users aliases groups

Typing "make" in /etc/postfix/ldap has this result:

    $ make
    cat users.proto credentials >users.tmp && mv users.tmp users
    cat aliases.proto credentials >aliases.tmp && mv aliases.tmp aliases
    cat groups.proto credentials >groups.tmp && mv groups.tmp groups

And after changing the users.proto file:

    $ make
    cat users.proto credentials >users.tmp && mv users.tmp users

That is it updates only files that need updating.

        Wietse

Reply via email to