<?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>Musings of an Apple Systems Administrator &#187; ldap</title>
	<atom:link href="http://www.jonsblog.org/tag/ldap/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonsblog.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 11 Jan 2012 19:33:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Backing up the OD Master</title>
		<link>http://www.jonsblog.org/2010/12/20/backing-up-the-od-master/</link>
		<comments>http://www.jonsblog.org/2010/12/20/backing-up-the-od-master/#comments</comments>
		<pubDate>Mon, 20 Dec 2010 14:43:27 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[ldap]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=216</guid>
		<description><![CDATA[Open directory on the Mac OSX Server platform is a great directory platform using Kerberos and LDAP however I have found that there are two steps to a flawless directory experience. Since the directory is such a delicate system I find it necessary to create a backup of the OD Master at least once a [...]]]></description>
			<content:encoded><![CDATA[<p>Open directory on the Mac OSX Server platform is a great directory platform using Kerberos and LDAP however I have found that there are two steps to a flawless directory experience. Since the directory is such a delicate system I find it necessary to create a backup of the OD Master at least once a day in the event that something goes south you can restore from any day in the past with ease. The other method is to use OD Replicas, and to use them often. A replica is far easier to fix than the actual OD Master if the master goes bad, and you have no backup then you have to decommission and start over, with replicas you can demote, and recreate without even having to deal with the OD Master.</p>
<p><strong>1. Backing up the OD Master with Bash</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
&nbsp;
<span style="color: #007800;">NOW</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #ff0000;">&quot;%m-%d-%Y&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Path to recovery directory (permissions should be 700 -- read-only root or admin)</span>
<span style="color: #007800;">recover</span>=<span style="color: #ff0000;">&quot;/Volumes/ODBackup&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Backup Open Directory</span>
<span style="color: #007800;">day</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #ff0000;">''</span>+<span style="color: #000000; font-weight: bold;">%</span>u<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">`</span>
&nbsp;
<span style="color: #007800;">od_backup</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$recover</span>/od_backup - &quot;</span><span style="color: #007800;">$NOW</span><span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #007800;">ts</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #ff0000;">''</span>+<span style="color: #000000; font-weight: bold;">%</span>F<span style="color: #ff0000;">''</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;dirserv:backupArchiveParams:archivePassword = 908239032&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$od_backup</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;dirserv:backupArchiveParams:archivePath = <span style="color: #007800;">$recover</span>/od_<span style="color: #007800;">$ts</span>&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$od_backup</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;dirserv:command = backupArchive&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$od_backup</span>
&nbsp;
serveradmin <span style="color: #7a0874; font-weight: bold;">command</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #007800;">$od_backup</span></pre></div></div>

<p>The above script when run on a daily basis through CRON or LAUNCHD will create a recoverable sparse disk image of your OD Master that you can use to restore from, it saves each master with a date time stamp so you can see which one is which and the instructions to restore are logged to a separate file. The two variables you must change are<br />
<span id="more-216"></span></p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Path to recovery directory (permissions should be 700 -- read-only root or admin)</span>
<span style="color: #007800;">recover</span>=<span style="color: #ff0000;">&quot;/Volumes/ODBackup&quot;</span></pre></div></div>

<p>This should be the location you want your OD Master backups to live, and</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;dirserv:backupArchiveParams:archivePassword = 908239032&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$od_backup</span></pre></div></div>

<p>the password must be changed as well in the above example the password is 908239032 you can change it to anything you want, this is required to restore when you attempt to restore your OD Master backup in Server Admin you will be prompted for this password.</p>
<p><strong>2. Create an OD Master Replica</strong></p>
<p>Before you start the firewall on the OD Master, the Firewall on the OD Replica server and the Firewall on your router must all have the following ports open, and or port forwarded to their appropriate destination. Open Ports 389, 636, 625, 22, 3659, 106, and 88.</p>
<ol>
<li>
Make sure the master, the prospective replica, and every firewall between them is configured to permit SSH communications (port 22).<br />
You can enable SSH for Mac OS X Server in Server Admin. Select the server in the Servers list, click Settings, click General, then select the Remote Login (SSH) option.</p>
<p>Make sure that SSH access is not restricted to certain users or groups (using SACLs) on the prospective master. This will cause Server Admin to not have the necessary permissions during creation of the replica. You can temporarily disable SACLs in Server Admin under Settings > Access.
</li>
<li>Open Server Admin and connect to the server.</li>
<li>Click the triangle to the left of the server.<br />
The list of services appears.</li>
<li>From the expanded Servers list, select Open Directory.</li>
<li>Click Settings, then click General.</li>
<li>Click Change.<br />
The Service Configuration Assistant opens.</li>
<li>Choose Open Directory Replica, then click Continue.</li>
<li>Enter the following requested information:</li>
<ul>
<li>IP address or DNS name of Open Directory master:  Enter the IP address or DNS name of the server that is the Open Directory master.</li>
<li>Root password on Open Directory master:  Enter the password of the Open Directory master system’s root user (user name system administrator).</li>
<li>Domain administrator’s short name:  Enter the name of an LDAP directory domain administrator account.</li>
<li>Domain administrator’s password:  Enter the password of the administrator account whose name you entered.</li>
</ul>
<li>Click Continue.</li>
<li>Confirm the Open Directory configuration settings, then click Continue.</li>
<li>Click Close.</li>
<li>Make sure the date, time, and time zone are correct on the replica and the master.<br />
The replica and the master should use the same network time service so their clocks remain in sync.</li>
</ol>
<p>Again the point here is to have a place for your users to authenticate against that can easily be fixed if any issues arise, in my setup I use the replicas to bind clients to for computer authentication, bind my Mail server to for account information and also use it as the basis for my LDAP environment. Replicas are great because they also reduce the response time, and since each server is synced as the users change their passwords or information its virtually instant. If a client is bound to my replica and the replica has a problem it will search for the next nearest replica, connect and authenticate against that which means almost no downtime as well.</p>
<p><strong>3. Carbon Copy Cloner</strong><br />
I am a huge fan of this software which can be found at <a href="http://www.bombich.com/">Carbon Copy Cloners website</a>. I use this software to do a full, incremental clone of my server, which is great because at any given time I can boot off of the backup drive and or restore directly to my server. </p>
<p>I am not going to write another how to on using Carbon Copy Cloner except to link to their own how to section which goes over it in so much more detail than I could here.</p>
<p><a href="http://help.bombich.com/kb/scheduling/save-task">Scheduling Tasks in Carbon Copy Cloner >></a><br />
<a href="http://help.bombich.com/kb/explore/backup-options">Backup Options for Carbon Copy Cloner >></a><br />
<a href="http://help.bombich.com/kb/explore/backup">A more granular approach to Backup (Must Read!!!) >></a></p>
<p>If you find their software useful I urge you to donate. </p>
<p>Wrapping things up a bit, I am a big fan of backups and these three options will keep you covered in the event of an Open Directory nightmare! If you have comments or other solutions I am always happy to hear from you and let me know how you approach backups with your systems!</p>
<p><b>** Note</b><br />
I was not able to get the above script to run properly with Cron, but it does however with LaunchD. Here is my LaunchD script, I named it com.odbackup.plist and placed it in the /Library/LaunchDaemons/ folder on my server, the script is set to run the backup every morning at 7:45am</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;</span>?xml <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #007800;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span>?<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;!</span>DOCTYPE plist PUBLIC -<span style="color: #000000; font-weight: bold;">//</span>Apple Computer<span style="color: #000000; font-weight: bold;">//</span>DTD PLIST <span style="color: #000000;">1.0</span><span style="color: #000000; font-weight: bold;">//</span>EN http:<span style="color: #000000; font-weight: bold;">//</span>www.apple.com<span style="color: #000000; font-weight: bold;">/</span>DTDs<span style="color: #000000; font-weight: bold;">/</span>PropertyList-<span style="color: #000000;">1.0</span>.dtd <span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;</span>plist <span style="color: #007800;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>Label<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>com.odbackup<span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>ProgramArguments<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>array<span style="color: #000000; font-weight: bold;">&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;/</span>bin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sh</span><span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span> 
        <span style="color: #000000; font-weight: bold;">&lt;</span>string<span style="color: #000000; font-weight: bold;">&gt;/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span>script<span style="color: #000000; font-weight: bold;">/</span>backup.sh<span style="color: #000000; font-weight: bold;">&lt;/</span>string<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;/</span>array<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>StartCalendarInterval<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
            <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>Hour<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
            <span style="color: #000000; font-weight: bold;">&lt;</span>integer<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000;">7</span><span style="color: #000000; font-weight: bold;">&lt;/</span>integer<span style="color: #000000; font-weight: bold;">&gt;</span>
            <span style="color: #000000; font-weight: bold;">&lt;</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>Minute<span style="color: #000000; font-weight: bold;">&lt;/</span>key<span style="color: #000000; font-weight: bold;">&gt;</span>
            <span style="color: #000000; font-weight: bold;">&lt;</span>integer<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000;">45</span><span style="color: #000000; font-weight: bold;">&lt;/</span>integer<span style="color: #000000; font-weight: bold;">&gt;</span>
        <span style="color: #000000; font-weight: bold;">&lt;/</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;/</span>dict<span style="color: #000000; font-weight: bold;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;/</span>plist<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>then you start the proceess by running load ctl /Library/LaunchDaemons/com.odbackup.plist or whatever you named it to see if its in the list run launchctl list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/12/20/backing-up-the-od-master/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>10.6.2 Squirrelmail, LDAP &amp; Sieve</title>
		<link>http://www.jonsblog.org/2010/01/23/squirrelmail-ldap-sieve/</link>
		<comments>http://www.jonsblog.org/2010/01/23/squirrelmail-ldap-sieve/#comments</comments>
		<pubDate>Sat, 23 Jan 2010 23:32:08 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[roundcube]]></category>
		<category><![CDATA[rules]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[side]]></category>
		<category><![CDATA[sieve]]></category>
		<category><![CDATA[squirrelmail]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=20</guid>
		<description><![CDATA[Snow Leopard 10.6 comes with built in Server Side rules (Sieve) that helps you to organize mail, if your like me and am supremely disappointed at the lack of functionality then you will be happy to know that there are alternatives out there. Snow Leopard still ships with a copy of Squirrel mail for OSX [...]]]></description>
			<content:encoded><![CDATA[<p>Snow Leopard 10.6 comes with built in Server Side rules (Sieve) that helps you to organize mail, if your like me and am supremely disappointed at the lack of functionality then you will be happy to know that there are alternatives out there. Snow Leopard still ships with a copy of Squirrel mail for OSX it also ships with many cool plugins for squirrel mail already installed. Lets look at the alternative to the built in Sieve scripts that ship with 10.6 Snow Leopard server.</p>
<p>To start with you must enable Sieve on your server to do this, start Server Admin, Mail &gt; Settings &gt; Advanced: Tick &#8220;PLAIN&#8221; on IMAP/POP and save it. Mail &gt; Settings &gt; Filters: Tick &#8220;Enable Server Side mail rules&#8221;, save it and restart the mail service. once your done here you will be able to use the built in web based interface for handling server side rules. However you can also install your own!</p>
<p>SquirrelMail is the default webmailer in SLS. You can use the plugin avelsieve to manage server side mail rules. Download avelsieve (I recommend version 1.9.9) and unpack in directory /usr/share/squirrelmail/plugins (so that directory avelsieve is within the plugins dir).</p>
<p>Note that you also need to download javascript_libs plugin, if you use a recent version (&gt;=1.9.8) of avelsieve. If you need the javascript_libs plugin, also unpack it in squirrelmail&#8217;s plugins dir. Then edit the file plugins/avelsieve/config/config.php (copy config_sample.php to config.php if not exisiting).</p>
<p>Change the authentication mechanism to</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$sieve_preferred_sasl_mech</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'PLAIN'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Edit file /usr/share/squirrelmail/config/config.php and register the plugin(s)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$plugins</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'avelsieve'</span><span style="color: #339933;">;</span> <span style="color: #000088;">$plugins</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'javascript_libs'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span></pre></div></div>

<p> <span id="more-20"></span><br />
only if using a newer version of avelsieve. See avelsieve page Access the Webmailer (http://&lt;SLS_server_name&gt;/webmail/ and check the filter connection.</p>
<p><strong>SquirrelMail</strong> is the default webmailer in SLS. You can use the plugin avelsieve to manage server side mail rules. Download avelsieve (I recommend version 1.9.9) and unpack in directory /usr/share/squirrelmail/plugins (so that directory avelsieve is within the plugins dir).Note that you also need to download javascript_libs plugin, if you use a recent version (&gt;=1.9.8) of avelsieve.If you need the javascript_libs plugin, also unpack it in squirrelmail&#8217;s plugins dir.</p>
<p>Then edit the file plugins/avelsieve/config/config.php (copy config_sample.php to config.php if not exisiting).Change the authentication mechanism to</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$sieve_preferred_sasl_mech</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'PLAIN'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Edit file /usr/share/squirrelmail/config/config.php and register the</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">plugin<span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000088;">$plugins</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'avelsieve'</span><span style="color: #339933;">;</span><span style="color: #000088;">$plugins</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'javascript_libs'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//</span></pre></div></div>

<p>only if using a newer version of avelsieve. See avelsieve page Access the Webmailer (http://&lt;SLS_server_name&gt;/webmail/ and check the filter connection.</p>
<p><strong>Roundcube</strong>: Sorrily Apple decided to use the old-fashioned, ugly SquirrelMail webmailer and not RoundCube. RoundCube is much nicer and also the &#8220;managesieve&#8221; plugin available for it is much better than avelsieve in SquirrelMail. Luckily you can install RoundCube on your SLS without harming the default installation.</p>
<p>Enable managesieve plugin ManageSieve plugin comes with RoundCube. To enable it, edit file roundcube/config/main.inc.php:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$rcmail_config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'plugins'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'managesieve'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Then edit file plugins/managesieve/lib/Net/Sieve.php comment line</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$supportedAuthMethods</span><span style="color: #339933;">=....</span> <span style="color: #009900;">&#40;</span>comment with <span style="color: #666666; font-style: italic;">//)</span></pre></div></div>

<p>uncomment line</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$supportedAuthMethods</span><span style="color: #339933;">=</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'PLAIN'</span> <span style="color: #339933;">,</span> <span style="color: #0000ff;">'Login'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Set timezone:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">date</span><span style="color: #339933;">.</span>timezone <span style="color: #339933;">=</span> Europe<span style="color: #339933;">/</span>Berlin</pre></div></div>

<p>Now test roundcube by accessing http:///roundcube/ Login as a user you like to change server side rules for. Click on &#8220;Settings&#8221; in the upper right corner, then on Filter. If you see the page and no error occurs, you are successfully connected to the sieve backend of IMAP! You now can create your rules.</p>
<p>The good thing is, that every rule managing application (Apple web rule management, SquirrelMail, RoundCube) you use, store its own file. So one app is not overwriting the others config file. This is of importance if you enable the apple built-in crippled rule management and store the rules, there. This creates an own file &#8220;wiki_server_rules.sieve&#8221; in your sieve script dir and enables it by the link dovecot.sieve -&gt; wiki_server_rules.sieve</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/23/squirrelmail-ldap-sieve/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>10.6.2 Roundcube &amp; LDAP</title>
		<link>http://www.jonsblog.org/2010/01/18/10-6-2-roundcube-ldap/</link>
		<comments>http://www.jonsblog.org/2010/01/18/10-6-2-roundcube-ldap/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 05:30:20 +0000</pubDate>
		<dc:creator>Jon Brown</dc:creator>
				<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[roundcube]]></category>
		<category><![CDATA[squirrelmail]]></category>
		<category><![CDATA[webmail]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=11</guid>
		<description><![CDATA[So like many other organizations mine was finally fed up with Horde as a webmail system. They had used squirrel mail in the past and was unimpressed by the graphical interface but admitted that it while it lacked glamour it always did perform as they would have expected. Before I had started there their mail [...]]]></description>
			<content:encoded><![CDATA[<p>So like many other organizations mine was finally fed up with Horde as a webmail system. They had used squirrel mail in the past and was unimpressed by the graphical interface but admitted that it while it lacked glamour it always did perform as they would have expected. Before I had started there their mail system was running on a Linux box using Plesk and running Horde as their primary webmail interface. Immediately I got them into an XServe running OSX mail since their entire organization consisted of Apple iMacs figured it was the way to go, and got them setup with Squirrelmail and Roundcube.</p>
<p>I found Roundcube to be extremely easy to setup, however sort of hard to configure and tweak for use on an OSX Server. The biggest drawback to the old mail system was that while everyone had email accounts they were local accounts meaning their was no LDAP database at work so there was no way to have an auto complete or global LDAP address book  that most of the people at our organization really craved. I decided that when moving to 10.6.2 we would have to get this feature established and I am documenting this here clearly as I found there was limited documentation for and I know there are many people using 10.6.2 and Roundcube together. </p>
<p>Once Roundcube is installed head over to main.inc.php in the Roundcube config directory. I wanted the user to have access to the LDAP address book and also have the ability to have their own so on this line make sure that SQL is chosen as the primarty type of address book if this is your intent.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$rcmail_config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'address_book_type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'sql'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>in the main.inc.php file the LDAP settings are kind of tricky. It gives  you an example of a functional LDAP setup below for an organization named Verisign locate these lines in the main.inc.php file<br />
<span id="more-11"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// In order to enable public ldap search, configure an array like the Verisign</span>
<span style="color: #666666; font-style: italic;">// example further below. if you would like to test, simply uncomment the example.</span>
<span style="color: #000088;">$rcmail_config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ldap_public'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>Verisign<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Notice that the third line is un-commented meaning that it is an active setting. Which means that what we are about to do below will not register until we comment out this line otherwise there will be two active configurations and neither will work this really tripped me up and had me stumped for days until I realized that I had two</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000088;">$rcmail_config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ldap_public'</span><span style="color: #009900;">&#93;</span></pre></td></tr></table></div>

<p> attributes at work at the same time so next comment this out as below.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// In order to enable public ldap search, configure an array like the Verisign</span>
<span style="color: #666666; font-style: italic;">// example further below. if you would like to test, simply uncomment the example.</span>
<span style="color: #666666; font-style: italic;">// $rcmail_config['ldap_public'] = array(Verisign);</span></pre></td></tr></table></div>

<p>Once this is done go down to the example below and start uncommenting the LDAP configuration lines one by one and filling out the information as you go here is an example of my configuration for the Name use whatever name you want the address book to show up as in the roundcube address book area. Your host name should be the fully qualified domain name of your directory server. Your default port on an ODM is 389. Only use TLS if you are using a secure SSL connection and always use User Specific so that the user is what is causing the OD Bind during lookups rather than the Directory Admin.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$rcmail_config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ldap_public'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Verisign'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
  <span style="color: #0000ff;">'name'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Company Name'</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'hosts'</span>         <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fullyqualified.domainofdirectoryserver.com'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'port'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">389</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'use_tls'</span>	    <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'user_specific'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>Next you must define the Base Search DN which is always your fully qualified domain name split up using dc= so if your directory name was directory.verisign.com then your base dn would be dc=directory, dc=verisign, dc=com. Here is what is not documented in many places it took me a long time to figure out that the Bind DN must have an active user or the directory admins UID here as well as cn=users, so that it knows how to find that user. I also configured mine to be non writable because I was unsure how safe this would be with the ODM.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #0000ff;">'base_dn'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dc=fullyqualified,dc=domainofdirectoryserver,dc=com'</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'bind_dn'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'uid=DirAdmin,cn=users,dc=fullyqualified,dc=domainofdirectoryserver,dc=com'</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'bind_pass'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'DirAdmin_Password'</span><span style="color: #339933;">,</span>
  <span style="color: #0000ff;">'writable'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>In order to get an actual accurate listing in the address book you must tweak the settings to include the specific user settings int he ODM LDAP directory.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #0000ff;">'LDAP_Object_Classes'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;top&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;person&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;inetOrgPerson&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;abxldapPerson&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> 
  <span style="color: #0000ff;">'required_fields'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;givenName&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;cn&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;sn&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;mail&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>    
  <span style="color: #0000ff;">'LDAP_rdn'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'mail'</span><span style="color: #339933;">,</span> 
  <span style="color: #0000ff;">'ldap_version'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">3</span><span style="color: #339933;">,</span>      
  <span style="color: #0000ff;">'search_fields'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'givenName'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cn'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sn'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>  <span style="color: #666666; font-style: italic;">// fields to search in</span>
  <span style="color: #0000ff;">'name_field'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'cn'</span><span style="color: #339933;">,</span>    
  <span style="color: #0000ff;">'email_field'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'mail'</span><span style="color: #339933;">,</span>  
  <span style="color: #0000ff;">'surname_field'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'sn'</span><span style="color: #339933;">,</span>   
  <span style="color: #0000ff;">'firstname_field'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'givenName'</span><span style="color: #339933;">,</span> 
  <span style="color: #0000ff;">'sort'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'givenName'</span><span style="color: #339933;">,</span>    
  <span style="color: #0000ff;">'scope'</span>         <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'sub'</span><span style="color: #339933;">,</span>  
  <span style="color: #0000ff;">'filter'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'givenName=*'</span><span style="color: #339933;">,</span>     
  <span style="color: #0000ff;">'fuzzy_search'</span>  <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>These settings will help you establish the correct mappings to Last Name, First Name, Email Address and Full Name or Given Name. These settings were very hard to find as there was limited documentation on both Apples part and on the Roundcube forums. Once done here I set it up to auto complete from the sql address book first and then to default over to the LDAP address book.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// An ordered array of the ids of the addressbooks that should be searched</span>
<span style="color: #666666; font-style: italic;">// when populating address autocomplete fields server-side. ex: array('sql','Verisign');</span>
<span style="color: #000088;">$rcmail_config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'autocomplete_addressbooks'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sql'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'Verisign'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>In parting my only piece of advice is to use the configuration here and remove the term Verisign and replace that variable with one that makes sense for you and your organization. Lastly if this does not work make sure that you have the correct domain name of the server and also ensure that you have enabled users to access the LDAP directory in Workgroup Manager.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/18/10-6-2-roundcube-ldap/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

