<?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; webmail</title>
	<atom:link href="http://www.jonsblog.org/tag/webmail/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonsblog.org</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sun, 01 Aug 2010 05:56:39 +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>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>admin</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.<span id="more-11"></span></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</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>5</slash:comments>
		</item>
		<item>
		<title>10.5.8 Server Upgrade : Mail</title>
		<link>http://www.jonsblog.org/2010/01/17/leopard-server-upgrade-mail-10-6-2/</link>
		<comments>http://www.jonsblog.org/2010/01/17/leopard-server-upgrade-mail-10-6-2/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 05:11:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Mail Server]]></category>
		<category><![CDATA[OSX Server Configuration]]></category>
		<category><![CDATA[OSX System Administration]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[servers]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[webmail]]></category>

		<guid isPermaLink="false">http://www.jonsblog.org/?p=5</guid>
		<description><![CDATA[Recently I have undergone a massive change, we have decided at our organization to go with Snow Leopard server in place of our Leopard Servers. Knowing that this could be problematic to use Apples built in GUI for migrating data I decided to start with a 100% clean configured Snow Leopard server and slowly start [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have undergone a massive change, we have decided at our organization to go with Snow Leopard server in place of our Leopard Servers. Knowing that this could be problematic to use Apples built in GUI for migrating data I decided to start with a 100% clean configured Snow Leopard server and slowly start to migrate items over to the new server. Our current Leopard Server was running an DNS, Open Directory Master, Mail, and Wiki Server services. I have decided to share my experience in migrating our mail from one server to another.</p>
<p>setup the 10.6.2 Snow Leopard server clean before I did anything I setup DNS on the server and manually retyped and rechecked all of the DNS records from the 10.5 server to the 10.6.2 server. Once I verified that the DNS records were set. I checked the server&#8217;s DNS by running sudo changeip -checkhostname and it came back clean. Great good to go, or so I thought.</p>
<p>I had setup split horizon DNS on the server, the Open Directory Master, has already been setup on a single use Mac Mini Server. The Mac Mini Server is running the ODM and DNS. The DNS on the Mini is self referencing and my router has the public ip mapped to the private. The new Mail server (10.6.2) also running DNS had a record pointing to the public ip of the ODM. Great, next step bind the mail server to the ODM so that I can start to migrate mail accounts.<span id="more-5"></span>I was working on this project around 10:00pm in the evening not knowing how long that it would take to migrate the accounts from Cyrus to Dovecot, but I had studied the Apple upgrade instructions for weeks prior so I felt like I had it totally under control. I followed the instructions and used the code from page 42 of the manual.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>libexec<span style="color: #000000; font-weight: bold;">/</span>dovecot<span style="color: #000000; font-weight: bold;">/</span>migrate_mail_data.pl <span style="color: #660033;">--moveMail</span> <span style="color: #000000;">0</span> <span style="color: #660033;">--cyrusBin</span> <span style="color: #ff0000;">&quot;/Volumes/10.5 Server Volume Name/usr/bin/cyrus/bin&quot;</span> <span style="color: #660033;">--database</span> <span style="color: #ff0000;">&quot;/Volumes/10.5 Server Volume Name/var/imap&quot;</span> <span style="color: #660033;">--sourceSpool</span> <span style="color: #ff0000;">&quot;/Volumes/10.5 Server Volume Name/var/spool/imap&quot;</span> <span style="color: #660033;">--targetSpool</span> <span style="color: #ff0000;">&quot;/var/spool/imap/dovecot/mail&quot;</span></pre></div></div>

<p>The script will tell you if your doing something wrong, which is helpful. My biggest question was how long would it take to migrate 30GB of mail to the new mail server. The answer, exactly two hours. I had decided that instead of using a firewire cable to connect the two servers together that I would simply pop the HD out of the old mail server and put it into the new server. This made a huge difference in the time of migration.</p>
<p>Once it finished I turned on mail, and everything started working fine. Great! I cleaned up my tools and logged out of the server and went home around 2am. The next few days were pure hell. As mentioned above I decided to use split horizon DNS. It was my first attempt at doing this and what I had noticed in the logs were a myriad of disconnect warnings every 5 min the mail server was getting disconnected from the ODM and then reconnecting causing some major issues.</p>
<p>The log files were filling up so fast that they were causing kernel panics, I had to reboot the server many times once every couple of hours, I decided to call Apple. The Apple representative captured my logs, and promptly told me that I would have to reformat the hard drive and completely start over. I told him that this was a clean install and that no way would I be starting over. He offered no other solution or advice other than telling me that it was not normal for a new server to have kernel panics this early in the game.</p>
<p>I decided to check my DNS turns out that the route statement in the router, was not properly entered. It was getting to the server but it was unable to retain a connection. I re-entered the route statement correctly and then rebooted the router. Almost immediately the issues stopped. Apple has come a long way in their migration capabilities if your ever having issues with your 10.6.2 mail service DNS is almost always the culprit!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonsblog.org/2010/01/17/leopard-server-upgrade-mail-10-6-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
