<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>My two ¢&#039;s &#187; ldap</title>
	<atom:link href="http://www.linuxaddicted.de/blog/tag/ldap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.linuxaddicted.de/blog</link>
	<description>A Gentoo addict, linux admin and developer</description>
	<lastBuildDate>Wed, 31 Mar 2010 12:12:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>BigIP Client Certificates</title>
		<link>http://www.linuxaddicted.de/blog/documentation/bigip-client-certificates/</link>
		<comments>http://www.linuxaddicted.de/blog/documentation/bigip-client-certificates/#comments</comments>
		<pubDate>Tue, 02 Dec 2008 18:22:28 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bigip]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://blog.linuxaddicted.de/?page_id=106</guid>
		<description><![CDATA[ table.addicted { border-width: 2px 2px 2px 2px; border-spacing: 0px; border-style: solid solid solid solid; border-color: gray gray gray gray; border-collapse: collapse; background-color: white; width: 80%; } table.addicted th { border-width: 1px 1px 1px 1px; padding: 1px 1px 1px 1px; border-style: outset outset outset outset; border-color: black black black black; background-color: #5c6d81; color: #000000; <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/documentation/bigip-client-certificates/">BigIP Client Certificates</a></span>]]></description>
			<content:encoded><![CDATA[<style type="text/css">
table.addicted {
        border-width: 2px 2px 2px 2px;
        border-spacing: 0px;
        border-style: solid solid solid solid;
        border-color: gray gray gray gray;
        border-collapse: collapse;
        background-color: white;
        width: 80%;
}
table.addicted th {
        border-width: 1px 1px 1px 1px;
        padding: 1px 1px 1px 1px;
        border-style: outset outset outset outset;
        border-color: black black black black;
        background-color: #5c6d81;
        color: #000000;
        -moz-border-radius: 0px 0px 0px 0px;
}
table.addicted td {
        border-width: 1px 1px 1px 1px;
        padding: 1px 1px 1px 1px;
        border-style: outset outset outset outset;
        border-color: black black black black;
        background-color: white;
        color: #000000;
        -moz-border-radius: 0px 0px 0px 0px;
        overflow: hidden;
}
</style>
<p>This howto will show you how to use client certificates to authenticate against applications hosted by a BigIP loadbalancer. You may find this howto (or parts of it) on <a href="http://ask.f5.com">ask.f5.com</a> as they was no documentation before on this topic. I forwarded it to F5 some time ago. <strong>This is the only way to use client certificates without purchasing addon modules from F5.</strong></p>
<h3>Purpose</h3>
<hr />
<p />
<p>If you host a website/application which should only be accessible by some users you you may have already thought about client certificates. This makes brute force attacks against login panels impossible.<br />
This increases the overall application security by adding another layer a user must pass.</p>
<p>The mapping between certificates and access rights is based on a LDAP directory.</p>
<h3>Overview</h3>
<hr />
<p />
<p>The loadbalancer reads the CN from the client certificate and searches the defined group for the virtual server for a matching entry. The loadbalancer verifies CA and CRL&#8217;s before the lookup takes place.</p>
<p><center><a href="http://blog.linuxaddicted.de/wp-content/uploads/2008/12/f5_ldap_auth.png"><img src="http://blog.linuxaddicted.de/wp-content/uploads/2008/12/f5_ldap_auth.png" alt="BigIP Certificate Auth" title="f5_ldap_auth" width="388" height="339" class="size-full wp-image-141" /></a></center></p>
<h3>LDAP Setup</h3>
<hr />
<p />
<p><strong>Example Tree</strong></p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">                            dc<span style="color: #339933;">=</span>company<span style="color: #339933;">,</span>dc<span style="color: #339933;">=</span>com
                              <span style="color: #339933;">/</span>         \
                             <span style="color: #339933;">/</span>           \
                           <span style="color: #339933;">...</span>      ou<span style="color: #339933;">=</span>datacenter
                                     <span style="color: #339933;">/</span>        \
                                    <span style="color: #339933;">/</span>          \
                                  <span style="color: #339933;">...</span>       ou<span style="color: #339933;">=</span>webauth
                                              <span style="color: #339933;">/</span>    \
                                             <span style="color: #339933;">/</span>      \
                                       ou<span style="color: #339933;">=</span>users    ou<span style="color: #339933;">=</span>groups</pre></div></div>

<p><strong>User &#038; Group LDIF</strong></p>
<p>Here are two LDIF examples for users and groups:</p>
<p><center>User</center><br />
<code>dn: cn=Example User,ou=users,ou=webauth,ou=datacenter,dc=company,dc=com<br />
cn: Example User<br />
sn: Example User<br />
objectClass: person<br />
description: It's just a example user<br />
</code></p>
<p />
<p><center>Group</center><br />
<code>dn: cn=Example Group,ou=groups,ou=webauth,ou=datacenter,dc=company,dc=com<br />
cn: Example Group<br />
objectClass: posixGroup<br />
description: Group is allowed to connect to BigIP's VHOST secure.company.com<br />
memberUid: cn=Example User,ou=users,ou=webauth,ou=datacenter,dc=company,dc=com<br />
memberUid: cn=Example User No2,ou=users,ou=webauth,ou=datacenter,dc=company,dc=com<br />
gidNumber: 145<br />
</code></p>
<p>The &#8220;memberUid&#8221; has to match exactly the certificates CN because this is the key the BigIP is looking for.</p>
<h3>BigIP Configuration</h3>
<hr />
<p />
<p><strong>Authentication Configuration</strong></p>
<p>As a firsz step we create a new &#8220;Authentication Configuration&#8221;. Just open the web frontend and navigate to:</p>
<p>Local Traffic -> Profiles -> Authentication -> Configuration</p>
<p>You have to create a new config for every virtual host you want to secure. This is force by the LDAP group used because every config can only use one group. Here&#8217;s a example configuration:</p>
<table class="addicted">
<tr>
<th width="30%"><strong>Parameter</strong></th>
<th width="70%"><strong>Value</strong></th>
</tr>
<tr>
<td>Hosts</td>
<td>1.2.3.4</td>
</tr>
<tr>
<td>Search Type</td>
<td>User</td>
</tr>
<tr>
<td>User Base DN</td>
<td>ou=users,ou=webauth,ou=datacenter,dc=company,dc=com</td>
</tr>
<tr>
<td>User Key</td>
<td>cn</td>
</tr>
</tr>
<tr>
<td>Admin DN</td>
<td>DN for binding</td>
</tr>
<tr>
<td>Admin Password</td>
<td>Bind password</td>
</tr>
<tr>
<td>Group Base DN</td>
<td>ou=groups,ou=webauth,ou=datacenter,dc=company,dc=com</td>
</tr>
<tr>
<td>Group Key</td>
<td>cn</td>
</tr>
<tr>
<td>Group Member Key</td>
<td>memberUid</td>
</tr>
<tr>
<td>Valid Groups</td>
<td>Corresponding LDAP group</td>
</tr>
</table>
<h3>Authentication Profile</h3>
<hr />
<p />
<p>The next step is to create a profile which inherits the new created config. You need a profile for every configuration. Navigate to </p>
<p>Local Traffic -> Profiles -> Authentication -> Profiles</p>
<table class="addicted">
<tr>
<th width="30%"><strong>Parameter</strong></th>
<th width="70%"><strong>Value</strong></th>
</tr>
<tr>
<td>Type</td>
<td>SSL Client Certificate LDAP</td>
</tr>
<tr>
<td>Parent Profile</td>
<td>ssl_cc_ldap</td>
</tr>
<tr>
<td>Mode</td>
<td>Enabled</td>
</tr>
<tr>
<td>Configuration</td>
<td>NAME OF CONF JUST CREATED</td>
</tr>
</table>
<h3>CA Upload</h3>
<hr />
<p />
<p>If your CA certificate(s) have not been installed it&#8217;s time to do so. </p>
<p>Local Traffic -> SSL Certificates -> Import</p>
<h3>SSL Profiles</h3>
<hr />
<p />
<p>To use SSL (without client certificates too) you need a SSL profile. Navigate to</p>
<p>Local Traffic -> Profiles -> SSL -> Client</p>
<p>Create a new profile based on &#8220;clientsl&#8221; or one of your already defined profiles.</p>
<table class="addicted">
<tr>
<th width="30%"><strong>Parameter</strong></th>
<th width="70%"><strong>Value</strong></th>
</tr>
<tr>
<td>Chain</td>
<td>CompanyBundle</td>
</tr>
<tr>
<td>Trusted Certificate Authorities</td>
<td>CompanyBundle</td>
</tr>
<tr>
<td>Client Certificate</td>
<td>require</td>
</tr>
<tr>
<td>Frequency</td>
<td>always</td>
</tr>
<tr>
<td>Advertised Certificate Authorities</td>
<td>CompanyBundle</td>
</tr>
</table>
<h3>Virtual Host Configuration</h3>
<hr />
<p />
<p>You may create a new virtual host or modify a existing host. Navigate here</p>
<p>Local Traffic -> Virtual Servers</p>
<p>Modify the following parameters (if you already used SSL in this vhost):</p>
<table class="addicted">
<tr>
<th width="30%"><strong>Parameter</strong></th>
<th width="70%"><strong>Value</strong></th>
</tr>
<tr>
<td>SSL Profile (Client)</td>
<td>Profile created earlier</td>
</tr>
<tr>
<td>Authentication Profiles</td>
<td>Profile created earlier</td>
</tr>
</table>
<h3>That&#8217;s it!</h3>
<hr />
<p />
<p>Import your client certificates to your browser and enjoy your secure connection.</p>
<p>If you have any trouble don&#8217;t hesitate to contact me: daniel {A_T} linuxaddicted {D_O_T} de</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/documentation/bigip-client-certificates/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Postfix Relay based on OpenLDAP</title>
		<link>http://www.linuxaddicted.de/blog/documentation/postfix-relay-based-on-openldap/</link>
		<comments>http://www.linuxaddicted.de/blog/documentation/postfix-relay-based-on-openldap/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 21:12:53 +0000</pubDate>
		<dc:creator>daniel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[postfix]]></category>
		<category><![CDATA[relay]]></category>

		<guid isPermaLink="false">http://blog.linuxaddicted.de/?page_id=70</guid>
		<description><![CDATA[<p>This howto describes the configuration of a Postfix relay based on OpenLDAP. These are the features of the relay:</p> User verification through LDAP Separation on internal and external users Greylisting User Relaying based on TLS and LDAP authentication Forwarding to local mailserver <p></p> /etc/postfix/main.cf <p /> ##################################################################### ## Global settings ##################################################################### queue_directory = /var/spool/postfix <span style="color:#777"> . . . &#8594; Read More: <a href="http://www.linuxaddicted.de/blog/documentation/postfix-relay-based-on-openldap/">Postfix Relay based on OpenLDAP</a></span>]]></description>
			<content:encoded><![CDATA[<p>This howto describes the configuration of a Postfix relay based on OpenLDAP. These are the features of the relay:</p>
<ul>
<li>User verification through LDAP</li>
<li>Separation on internal and external users</li>
<li>Greylisting</li>
<li>User Relaying based on TLS and LDAP authentication</li>
<li>Forwarding to local mailserver</li>
</ul>
<p><span id="more-70"></span></p>
<h3>/etc/postfix/main.cf</h3>
<hr />
<p />

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#####################################################################</span>
<span style="color: #666666; font-style: italic;">## Global settings</span>
<span style="color: #666666; font-style: italic;">#####################################################################</span>
queue_directory <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>var<span style="color: #339933;">/</span>spool<span style="color: #339933;">/</span>postfix
command_directory <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>sbin
daemon_directory <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>lib<span style="color: #339933;">/</span>postfix
mail_owner <span style="color: #339933;">=</span> postfix
smtpd_banner <span style="color: #339933;">=</span> mail<span style="color: #339933;">.</span>company<span style="color: #339933;">.</span>com ESMTP MailRelay
sendmail_path <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>sbin<span style="color: #339933;">/</span>sendmail
newaliases_path <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>newaliases
mailq_path <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>bin<span style="color: #339933;">/</span>mailq
setgid_group <span style="color: #339933;">=</span> postdrop
html_directory <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>share<span style="color: #339933;">/</span>doc<span style="color: #339933;">/</span>postfix<span style="color: #339933;">-</span>2<span style="color: #339933;">.</span>3<span style="color: #339933;">.</span>6<span style="color: #339933;">/</span>html
manpage_directory <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>share<span style="color: #339933;">/</span>man
sample_directory <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>postfix
readme_directory <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>usr<span style="color: #339933;">/</span>share<span style="color: #339933;">/</span>doc<span style="color: #339933;">/</span>postfix<span style="color: #339933;">-</span>2<span style="color: #339933;">.</span>3<span style="color: #339933;">.</span>6<span style="color: #339933;">/</span>readme
home_mailbox <span style="color: #339933;">=</span> <span style="color: #339933;">.</span>maildir<span style="color: #339933;">/</span>
alias_database <span style="color: #339933;">=</span> hash<span style="color: #339933;">:/</span>etc<span style="color: #339933;">/</span>mail<span style="color: #339933;">/</span>aliases
&nbsp;
<span style="color: #666666; font-style: italic;">#####################################################################</span>
<span style="color: #666666; font-style: italic;">## Internet and domain names</span>
<span style="color: #666666; font-style: italic;">#####################################################################</span>
myhostname <span style="color: #339933;">=</span> mail<span style="color: #339933;">.</span>company<span style="color: #339933;">.</span>com
mydomain <span style="color: #339933;">=</span> company<span style="color: #339933;">.</span>com
&nbsp;
<span style="color: #666666; font-style: italic;">#####################################################################</span>
<span style="color: #666666; font-style: italic;">## Sending mail (local)</span>
<span style="color: #666666; font-style: italic;">#####################################################################</span>
myorigin <span style="color: #339933;">=</span> company<span style="color: #339933;">.</span>com
&nbsp;
<span style="color: #666666; font-style: italic;">#####################################################################</span>
<span style="color: #666666; font-style: italic;">## Receiving mail</span>
<span style="color: #666666; font-style: italic;">#####################################################################</span>
inet_interfaces <span style="color: #339933;">=</span> all
proxy_interfaces <span style="color: #339933;">=</span>
mydestination <span style="color: #339933;">=</span>
local_recipient_maps <span style="color: #339933;">=</span></pre></div></div>

<p>As incoming mail doesn&#8217;t terminate on the relay we have to remove the values from &#8220;mydestination&#8221;.<br />
That&#8217;s why &#8220;local_recipients&#8221; is unset as well.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#####################################################################</span>
<span style="color: #666666; font-style: italic;">## Relay control</span>
<span style="color: #666666; font-style: italic;">#####################################################################</span>
relay_domains <span style="color: #339933;">=</span> company<span style="color: #339933;">.</span>com
relay_recipient_maps <span style="color: #339933;">=</span> proxy<span style="color: #339933;">:</span>ldap<span style="color: #339933;">:/</span>etc<span style="color: #339933;">/</span>postfix<span style="color: #339933;">/</span>ldap<span style="color: #339933;">/</span>relay_recipients<span style="color: #339933;">.</span>cf
mynetworks <span style="color: #339933;">=</span> 192<span style="color: #339933;">.</span>168<span style="color: #339933;">.</span>1<span style="color: #339933;">.</span>0<span style="color: #339933;">/</span><span style="color: #cc66cc;">28</span></pre></div></div>

<p>The relay_recipient_map contains the users that mail should be relayed for. It&#8217;s not a static list as you may have used it before. It contains the definition where and how to find valid users within the LDAP directory.</p>
<p>The parameter &#8220;mynetworks&#8221; contains the network of the internal mailservers. There are better (and more secure) ways to do this but for not it&#8217;s sufficient.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#####################################################################</span>
<span style="color: #666666; font-style: italic;">## Mail transport</span>
<span style="color: #666666; font-style: italic;">#####################################################################</span>
transport_maps <span style="color: #339933;">=</span> hash<span style="color: #339933;">:/</span>etc<span style="color: #339933;">/</span>postfix<span style="color: #339933;">/</span>transport</pre></div></div>

<p>Transport maps define the target system based on the domain.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#####################################################################</span>
<span style="color: #666666; font-style: italic;">## SASL configuration</span>
<span style="color: #666666; font-style: italic;">#####################################################################</span>
smtpd_sasl_auth_enable <span style="color: #339933;">=</span> yes
smtpd_sasl_security_options <span style="color: #339933;">=</span> noanonymous
smtpd_sasl_local_domain <span style="color: #339933;">=</span> <span style="color: #0000ff;">$myhostname</span>
broken_sasl_auth_clients <span style="color: #339933;">=</span> yes
smtpd_sasl_auth_clients <span style="color: #339933;">=</span> yes
&nbsp;
<span style="color: #666666; font-style: italic;">#####################################################################</span>
<span style="color: #666666; font-style: italic;">## TLS configuration</span>
<span style="color: #666666; font-style: italic;">#####################################################################</span>
smtpd_use_tls <span style="color: #339933;">=</span> yes
smtpd_tls_auth_only <span style="color: #339933;">=</span> yes
smtpd_tls_loglevel <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span>
&nbsp;
smtpd_tls_CAfile <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>postfix<span style="color: #339933;">/</span>ssl<span style="color: #339933;">/</span>company<span style="color: #339933;">-</span>bundle<span style="color: #339933;">.</span>crt
smtpd_tls_key_file <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>postfix<span style="color: #339933;">/</span>ssl<span style="color: #339933;">/</span>mail<span style="color: #339933;">.</span>company<span style="color: #339933;">.</span>com<span style="color: #339933;">.</span>key<span style="color: #339933;">.</span>pem
smtpd_tls_cert_file <span style="color: #339933;">=</span> <span style="color: #339933;">/</span>etc<span style="color: #339933;">/</span>postfix<span style="color: #339933;">/</span>ssl<span style="color: #339933;">/</span>mail<span style="color: #339933;">.</span>company<span style="color: #339933;">.</span>com<span style="color: #339933;">.</span>cert<span style="color: #339933;">.</span>pem</pre></div></div>

<p>The SASL configuration should be pretty self explanatory. It&#8217;s madatory that &#8220;smtpd_sasl_security_options&#8221; are set to &#8220;noanonymous&#8221;. If not it would be possible to logon anonymously. This settings force TLS encryption for every login. No TLS -&gt; No Login. The creation and maintenance of SSL certificates is not covered by this howto.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#####################################################################</span>
<span style="color: #666666; font-style: italic;">## SMTP restrictions</span>
<span style="color: #666666; font-style: italic;">#####################################################################</span>
smtpd_recipient_restrictions <span style="color: #339933;">=</span> permit_sasl_authenticated<span style="color: #339933;">,</span>
permit_mynetworks<span style="color: #339933;">,</span>
check_policy_service unix<span style="color: #339933;">:</span>private<span style="color: #339933;">/</span>postgrey<span style="color: #339933;">,</span>
reject_unauth_destination<span style="color: #339933;">,</span>
permit</pre></div></div>

<p>These parameters declare what has to be accomplished that mail is accepted:</p>
<ul>
<li>Sucessful SASL logon</li>
<li>Mail comes from a trusted network</li>
<li>Postgrey is happy and agreed</li>
</ul>
<h3>/etc/postfix/master.cf</h3>
<hr />
<p />
<p>Disable local transport&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #339933;">...</span>
<span style="color: #666666; font-style: italic;">#local     unix  -       n       n       -       -       local</span>
<span style="color: #339933;">...</span></pre></div></div>

<h3>/etc/postfix/transport</h3>
<hr />
<p />

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">company<span style="color: #339933;">.</span>com        smtp<span style="color: #339933;">:</span><span style="color: #009900;">&#91;</span>mailgw<span style="color: #339933;">-</span><span style="color: #000066;">int</span><span style="color: #339933;">.</span>company<span style="color: #339933;">.</span>com<span style="color: #009900;">&#93;</span></pre></div></div>

<p>This map defines the target mailserver mailgw-int.company.com for the domain company.com.<br />
The square brackets skip the DNS MX check for every delivery.</p>
<p>Don&#8217;t forget to convert the map after editing:</p>
<p>[color=red]Nach dem ändern der Map das konvertieren nicht vergessen[/color]:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># postmap hash:/etc/postfix/transport</span></pre></div></div>

<h3>/etc/postfix/ldap/relay_recipients.cf</h3>
<hr />
<p />

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #000066;">bind</span>             <span style="color: #339933;">=</span> yes
bind_dn          <span style="color: #339933;">=</span> cn<span style="color: #339933;">=</span>SMTP Lookup<span style="color: #339933;">,</span>dc<span style="color: #339933;">=</span>company<span style="color: #339933;">,</span>dc<span style="color: #339933;">=</span>com
bind_pw          <span style="color: #339933;">=</span> THISisABSOLUTLYsecret
server_host      <span style="color: #339933;">=</span> ldap<span style="color: #339933;">://</span>1<span style="color: #339933;">.</span>2<span style="color: #339933;">.</span>3<span style="color: #339933;">.</span>4
search_base      <span style="color: #339933;">=</span> ou<span style="color: #339933;">=</span>mail<span style="color: #339933;">,</span>o<span style="color: #339933;">=</span>datacenter<span style="color: #339933;">,</span>c<span style="color: #339933;">=</span>de<span style="color: #339933;">,</span>dc<span style="color: #339933;">=</span>company<span style="color: #339933;">,</span>dc<span style="color: #339933;">=</span>com
query_filter     <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&amp;amp</span><span style="color: #339933;">;</span><span style="color: #009900;">&#40;</span>maildrop<span style="color: #339933;">=</span><span style="color: #0000ff;">%s</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span>destinationIndicator<span style="color: #339933;">=</span>external<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
result_attribute <span style="color: #339933;">=</span> uid
version          <span style="color: #339933;">=</span> <span style="color: #cc66cc;">3</span></pre></div></div>

<p>Should be pretty easy to understand. The most important part is the query filter. I use a combination of maildrop and destinationIndicator. This makes in pretty easy to seperate innternl from external users. This makes it possible to protect internal mailgroups from external access. &#8220;%s&#8221; will be replaced by the recipients address.</p>
<p>Example LDAP entry:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">dn<span style="color: #339933;">:</span> uid<span style="color: #339933;">=</span>admin<span style="color: #339933;">,</span>ou<span style="color: #339933;">=</span>mail<span style="color: #339933;">,</span>o<span style="color: #339933;">=</span>datacenter<span style="color: #339933;">,</span>c<span style="color: #339933;">=</span>de<span style="color: #339933;">,</span>dc<span style="color: #339933;">=</span>company<span style="color: #339933;">,</span>dc<span style="color: #339933;">=</span>com
cn<span style="color: #339933;">:</span> Admin
destinationIndicator<span style="color: #339933;">:</span> external
gidNumber<span style="color: #339933;">:</span> <span style="color: #cc66cc;">505</span>
givenName<span style="color: #339933;">:</span> admin
homeDirectory<span style="color: #339933;">:</span> <span style="color: #339933;">/</span>var<span style="color: #339933;">/</span>spool<span style="color: #339933;">/</span>mail<span style="color: #339933;">/</span>admin
mail<span style="color: #339933;">:</span> admin<span style="color: #0000ff;">@company</span><span style="color: #339933;">.</span>com
mailbox<span style="color: #339933;">:</span> <span style="color: #339933;">/</span>var<span style="color: #339933;">/</span>spool<span style="color: #339933;">/</span>mail<span style="color: #339933;">/</span>admin<span style="color: #339933;">/</span>Maildir
maildrop<span style="color: #339933;">:</span> admin<span style="color: #0000ff;">@company</span><span style="color: #339933;">.</span>com
maildrop<span style="color: #339933;">:</span> postmaster<span style="color: #0000ff;">@company</span><span style="color: #339933;">.</span>com
maildrop<span style="color: #339933;">:</span> abuse<span style="color: #0000ff;">@company</span><span style="color: #339933;">.</span>com
objectClass<span style="color: #339933;">:</span> CourierMailAlias
objectClass<span style="color: #339933;">:</span> CourierMailAccount
objectClass<span style="color: #339933;">:</span> inetOrgPerson
sn<span style="color: #339933;">:</span> admin
uid<span style="color: #339933;">:</span> admin
uidNumber<span style="color: #339933;">:</span> <span style="color: #cc66cc;">505</span>
userPassword<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>CRYPT<span style="color: #009900;">&#125;</span>AbCdEfGhIjKlMnOpQrStUvWxYz</pre></div></div>

<p>The destinationIndicator declares if the user can receive external mails. All maildrop lines are aliases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.linuxaddicted.de/blog/documentation/postfix-relay-based-on-openldap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

