Manual Pages for UNIX Darwin command on man ldap_table
MyWebUniversity

Manual Pages for UNIX Darwin command on man ldap_table

LDAPTABLE(5) LDAPTABLE(5)

NAME

ldaptable - Postfix LDAP client configuration

SYNOPSIS

ppoossttmmaapp -qq ""string"" llddaapp:://eettcc//ppoossttffiixx//ffiilleennaammee

ppoossttmmaapp -qq - llddaapp:://eettcc//ppoossttffiixx//filename

DESCRIPTION

The Postfix mail system uses optional tables for address rewriting or mail routing. These tables are usually in ddbbmm or ddbb format. Alternatively, lookup tables can be specified as LDAP databases. In order to use LDAP lookups, define an LDAP source as a lookup table in main.cf, for example:

aliasmaps = ldap:/etc/postfix/ldap-aliases.cf

The file /etc/postfix/ldap-aliases.cf has the same format as the Post-

fix main.cf file, and can specify the parameters described below. An example is given at the end of this manual. This configuration method is available with Postfix version 2.1 and

later. See the section "BACKWARDS COMPATIBILITY" below for older Post-

fix versions. For details about LDAP SSL and STARTTLS, see the section on SSL and STARTTLS below. BBAACCKKWWAARRDDSS CCOOMMPPAATTIIBBIILLIITTYY For backwards compatibility with Postfix version 2.0 and earlier, LDAP parameters can also be defined in main.cf. Specify as LDAP source a name that doesn't begin with a slash or a dot. The LDAP parameters

will then be accessible as the name you've given the source in its def-

inition, an underscore, and the name of the parameter. For example, if the map is specified as "ldap:ldapsource", the "serverhost" parameter below would be defined in main.cf as "ldapsourceserverhost". Note: with this form, the passwords for the LDAP sources are written in

main.cf, which is normally world-readable. Support for this form will

be removed in a future Postfix version. LLIISSTT MMEEMMBBEERRSSHHIIPP

When using LDAP to store lists such as $mynetworks, $mydestination,

$relaydomains, $localrecipientmaps, etc., it is important to under-

stand that the table must store each list member as a separate key. The table lookup verifies the *existence* of the key. See "Postfix lists versus tables" in the DATABASEREADME document for a discussion.

Do NOT create tables that return the full list of domains in $mydesti-

nation or $relaydomains etc., or IP addresses in $mynetworks.

DO create tables with each matching item as a key and with an arbitrary value. With LDAP databases it is not uncommon to return the key itself.

For example, NEVER do this in a map defining $mydestination:

queryfilter = domain=* resultattribute = domain Do this instead:

queryfilter = domain=%s

resultattribute = domain GGEENNEERRAALL LLDDAAPP PPAARRAAMMEETTEERRSS In the text below, default values are given in parentheses. Note: don't use quotes in these variables; at least, not until the Postfix configuration routines understand how to deal with quoted strings. sseerrvveerrhhoosstt ((ddeeffaauulltt:: llooccaallhhoosstt)) The name of the host running the LDAP server, e.g. serverhost = ldap.your.com Depending on the LDAP client library you're using, it should be

possible to specify multiple servers here, with the library try-

ing them in order should the first one fail. It should also be

possible to give each server in the list a different port (over-

riding sseerrvveerrppoorrtt below), by naming them like serverhost = ldap.your.com:1444 With OpenLDAP, a (list of) LDAP URLs can be used to specify both the hostname(s) and the port(s): serverhost = ldap://ldap.your.com:1444 All LDAP URLs accepted by the OpenLDAP library are supported, including connections over UNIX domain sockets, and LDAP SSL (the last one provided that OpenLDAP was compiled with support for SSL):

serverhost = ldapi://%2Fsome%2Fpath

serverhost = ldaps://ldap.your.com:636 sseerrvveerrppoorrtt ((ddeeffaauulltt:: 338899)) The port the LDAP server listens on, e.g. serverport = 778 sseeaarrcchhbbaassee ((NNoo ddeeffaauulltt;; yyoouu mmuusstt ccoonnffiigguurree tthhiiss)) The RFC2253 base DN at which to conduct the search, e.g. searchbase = dc=your, dc=com ttiimmeeoouutt ((ddeeffaauulltt:: 1100 sseeccoonnddss)) The number of seconds a search can take before timing out, e.g. timeout = 5

qquueerryyffiilltteerr ((ddeeffaauulltt:: mmaaiillaacccceeppttiinnggggeenneerraalliidd==%%ss))

The RFC2254 filter used to search the directory, where %%ss is a

substitute for the address Postfix is trying to resolve, e.g.

queryfilter = (&(mail=%s)(paidup=true))

This parameter supports the following '%' expansions:

%%ss This is replaced by the input key. RFC 2254 quoting is

used to make sure that the input key does not add unex-

pected metacharacters.

%%uu When the input key is an address of the form user@domain,

%%uu is replaced by the (RFC 2254) quoted local part of the

address. If no domain is specified, %%uu is replaced by the

entire search string.

%%dd When the input key is an address of the form user@domain,

%%dd is replaced by the (RFC 2254) quoted domain part of

the address. When the input key has no domain qualifier,

%%dd is replaced by the entire search string.

The "domain" parameter described below limits the input keys to addresses in matching domains. When the "domain" parameter is

non-empty, LDAP queries for unqualified addresses or addresses

in non-matching domains are suppressed and return no results.

NOTE: DO NOT put quotes around the query filter.

rreessuullttffiilltteerr ((ddeeffaauulltt:: %%ss)

Format template applied to result attributes. Supports the same expansions as the queryfilter, and can be easily used to append

(or prepend) text. This parameter supports the following '%'

expansions:

%%ss This is replaced by the value of the result attribute.

%%uu When the result attribute is an address of the form

user@domain, %%uu is replaced local part of the address, if

the result attribute is unqualified, %%uu is replaced by

the entire attribute value.

%%dd When a result attribute is an address of the form

user@domain, %%dd is replaced by the domain part of the

attribute value. If an attribute value is unqualified %%dd

is replaced by the entire attribute value.

For example, using "resultfilter = smtp:[%s]" allows one to use

a mailHost attribute as the basis of a transport(5) table. After applying the result filter, multiple values are concatenated as comma separated strings. The expansionlimit and sizelimit parameters explained below allow one to restrict the number of values in the result, which is especially useful for maps that should return a single value.

The default value %%ss specifies that each attribute value should

be used as is.

NOTE: DO NOT put quotes around the result filter!

ddoommaaiinn ((ddeeffaauulltt:: nnoo ddoommaaiinn lliisstt)) This is a list of domain names, paths to files, or dictionaries.

When specified, only fully qualified search keys with a *non-

empty* localpart and a matching domain are eligible for lookup: 'user' lookups, bare domain lookups and "@domain" lookups are not performed. This can significantly reduce the query load on the LDAP server. domain = postfix.org, hash:/etc/postfix/searchdomains It is best not to use LDAP to store the domains eligible for LDAP lookups.

NOTE: DO NOT define this parameter for local(8) aliases.

rreessuullttaattttrriibbuuttee ((ddeeffaauulltt:: mmaaiillddrroopp)) The attribute(s) Postfix will read from any directory entries returned by the lookup, to be resolved to an email address. resultattribute = mailbox,maildrop ssppeecciiaallrreessuullttaattttrriibbuuttee ((NNoo ddeeffaauulltt)) The attribute(s) of directory entries that can contain DNs or URLs. If found, a recursive subsequent search is done using their values. specialresultattribute = member DN recursion retrieves the same resultattributes as the main query, including the special attributes for further recursion. URI processing retrieves only those attributes that are included in the URI definition and are *also* listed in "resultattribute". If the URI lists any of the map's special

result attributes, these are also retrieved and used recur-

sively. ssccooppee ((ddeeffaauulltt:: ssuubb)) The LDAP search scope: ssuubb, bbaassee, or oonnee. These translate into LDAPSCOPESUBTREE, LDAPSCOPEBASE, and LDAPSCOPEONELEVEL. bbiinndd ((ddeeffaauulltt:: yyeess))

Whether or not to bind to the LDAP server. Newer LDAP implemen-

tations don't require clients to bind, which saves time. Exam-

ple: bind = no If you do need to bind, you might consider configuring Postfix to connect to the local machine on a port that's an SSL tunnel

to your LDAP server. If your LDAP server doesn't natively sup-

port SSL, put a tunnel (wrapper, proxy, whatever you want to call it) on that system too. This should prevent the password from traversing the network in the clear. bbiinnddddnn ((ddeeffaauulltt:: eemmppttyy)) If you do have to bind, do it with this distinguished name. Example: binddn = uid=postfix, dc=your, dc=com bbiinnddppww ((ddeeffaauulltt:: eemmppttyy)) The password for the distinguished name above. If you have to use this, you probably want to make the map configuration file readable only by the Postfix user. When using the obsolete ldap:ldapsource syntax, with map parameters in main.cf, it is not possible to securely store the bind password. This is because main.cf needs to be world readable to allow local accounts to submit mail via the sendmail command. Example: bindpw = postfixpw ccaacchhee ((IIGGNNOORREEDD wwiitthh aa wwaarrnniinngg)) ccaacchheeeexxppiirryy ((IIGGNNOORREEDD wwiitthh aa wwaarrnniinngg)) ccaacchheessiizzee ((IIGGNNOORREEDD wwiitthh aa wwaarrnniinngg)) The above parameters are NO LONGER SUPPORTED by Postfix. Cache support has been dropped from OpenLDAP as of release 2.1.13. rreeccuurrssiioonnlliimmiitt ((ddeeffaauulltt:: 11000000)) A limit on the nesting depth of DN and URL special result

attribute evaluation. The limit must be a non-zero positive num-

ber. eexxppaannssiioonnlliimmiitt ((ddeeffaauulltt:: 00)) A limit on the total number of result elements returned (as a comma separated list) by a lookup against the map. A setting of zero disables the limit. Lookups fail with a temporary error if the limit is exceeded. Setting the limit to 1 ensures that lookups do not return multiple values.

ssiizzeelliimmiitt ((ddeeffaauulltt:: $$eexxppaannssiioonnlliimmiitt))

A limit on the number of LDAP entries returned by any single

LDAP query performed as part of the lookup. A setting of 0 dis-

ables the limit. Expansion of DN and URL references involves nested LDAP queries, each of which is separately subjected to this limit. Note: even a single LDAP entry can generate multiple lookup

results, via multiple result attributes and/or multi-valued

result attributes. This limit caps the per query resource uti-

lization on the LDAP server, not the final multiplicity of the

lookup result. It is analogous to the "-z" option of

"ldapsearch". ddeerreeffeerreennccee ((ddeeffaauulltt:: 00)) When to dereference LDAP aliases. (Note that this has nothing do with Postfix aliases.) The permitted values are those legal for the OpenLDAP/UM LDAP implementations: 0 never 1 when searching 2 when locating the base object for the search 3 always See ldap.h or the ldapopen(3) or ldapsearch(1) man pages for more information. And if you're using an LDAP package that has other possible values, please bring it to the attention of the

postfix-users@postfix.org mailing list.

cchhaasseerreeffeerrrraallss ((ddeeffaauulltt:: 00)) Sets (or clears) LDAPOPTREFERRALS (requires LDAP version 3 support). vveerrssiioonn ((ddeeffaauulltt:: 22)) Specifies the LDAP protocol version to use. ddeebbuugglleevveell ((ddeeffaauulltt:: 00)) What level to set for debugging in the OpenLDAP libraries. LLDDAAPP SSSSLL AANNDD SSTTAARRTTTTLLSS PPAARRAAMMEETTEERRSS

If you're using the OpenLDAP libraries compiled with SSL support, Post-

fix can connect to LDAP SSL servers and can issue the STARTTLS command. LDAP SSL service can be requested by using a LDAP SSL URL in the serverhost parameter: serverhost = ldaps://ldap.your.com:636 STARTTLS can be turned on with the starttls parameter: starttls = yes

Both forms require LDAP protocol version 3, which has to be set explic-

itly with: version = 3

If any of the Postfix programs querying the map is configured in mas-

ter.cf to run chrooted, all the certificates and keys involved have to be copied to the chroot jail. Of course, the private keys should only be readable by the user "postfix". The following parameters are relevant to LDAP SSL and STARTTLS: ssttaarrttttllss ((ddeeffaauulltt:: nnoo)) Whether or not to issue STARTTLS upon connection to the server.

Don't set this with LDAP SSL (the SSL session is setup automati-

cally when the TCP connection is opened). ttllssccaacceerrttddiirr ((NNoo ddeeffaauulltt;; sseett eeiitthheerr tthhiiss oorr ttllssccaacceerrttffiillee)) Directory containing X509 Certificate Authority certificates in PEM format which are to be recognized by the client in SSL/TLS connections. The files each contain one CA certificate. The files are looked up by the CA subject name hash value, which must hence be available. If more than one CA certificate with the same name hash value exist, the extension must be different (e.g. 9d66eef0.0, 9d66eef0.1 etc). The search is performed in

the ordering of the extension number, regardless of other prop-

erties of the certificates. Use the crehash utility (from the OpenSSL distribution) to create the necessary links. ttllssccaacceerrttffiillee ((NNoo ddeeffaauulltt;; sseett eeiitthheerr tthhiiss oorr ttllssccaacceerrttddiirr)) File containing the X509 Certificate Authority certificates in PEM format which are to be recognized by the client in SSL/TLS connections. This setting takes precedence over tlscacertdir. ttllsscceerrtt ((NNoo ddeeffaauulltt;; yyoouu mmuusstt sseett tthhiiss)) File containing client's X509 certificate to be used by the client in SSL/ TLS connections. ttllsskkeeyy ((NNoo ddeeffaauulltt;; yyoouu mmuusstt sseett tthhiiss)) File containing the private key corresponding to the above tlscert. ttllssrreeqquuiirreecceerrtt ((ddeeffaauulltt:: nnoo)) Whether or not to request server's X509 certificate and check its validity when establishing SSL/TLS connections. ttllssrraannddoommffiillee ((NNoo ddeeffaauulltt)) Path of a file to obtain random bits from when /dev/[u]random is not available, to be used by the client in SSL/TLS connections. ttllsscciipphheerrssuuiittee ((NNoo ddeeffaauulltt)) Cipher suite to use in SSL/TLS negotiations. EEXXAAMMPPLLEE Here's a basic example for using LDAP to look up local(8) aliases. Assume that in main.cf, you have: aliasmaps = hash:/etc/aliases,

ldap:/etc/postfix/ldap-aliases.cf

and in ldap:/etc/postfix/ldap-aliases.cf you have:

serverhost = ldap.my.com searchbase = dc=my, dc=com Upon receiving mail for a local address "ldapuser" that isn't found in

the /etc/aliases database, Postfix will search the LDAP server listen-

ing at port 389 on ldap.my.com. It will bind anonymously, search for

any directory entries whose mailacceptinggeneralid attribute is "lda-

puser", read the "maildrop" attributes of those found, and build a list of their maildrops, which will be treated as RFC822 addresses to which the message will be delivered.

SEE ALSO

postmap(1), Postfix lookup table manager postconf(5), configuration parameters mysqltable(5), MySQL lookup tables pgsqltable(5), PostgreSQL lookup tables README FILES Use "ppoossttccoonnff rreeaaddmmeeddiirreeccttoorryy" or "ppoossttccoonnff hhttmmllddiirreeccttoorryy" to locate this information. DATABASEREADME, Postfix lookup table overview LDAPREADME, Postfix LDAP client guide LLIICCEENNSSEE The Secure Mailer license must be distributed with this software. AUTHOR(S)

Carsten Hoeger, Hery Rakotoarisoa, John Hensley, Keith Stevenson, LaM-

ont Jones, Liviu Daia, Manuel Guesdon, Mike Mattice, Prabhat K Singh, Sami Haahtinen, Samuel Tardieu, Victor Duchovni, and many others. LDAPTABLE(5)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™