Instructions

Allright, a bit later than I had anticipated and planned. But that’s what you get if Apple starts releasing stuff earlier then expected. It screws with your planning. But the instructions for installing the basic mailserver in 64 bits are finished and tested on my MacBook Pro. This new machine is a god send and worth every penny up to now.

Please note that these are my initial instructions using an upgraded machine. Next up I need to test the instructions on a clean install of Snow Leopard. When that’s done I will upgrade my Core Duo mini to Snow Leopard and see how the 32 bits version will work out.

Happy reading: The mailserver on Snow Leopard

Good luck and can you please let me know if it worked for you?

1 comment

Sometimes it’s difficult to send email as some providers block port 25. They will force you to use their mailserver for outgoing mail. I recently encountered this phenomenon when I spend some time in a hotel for work. Their setup blocked port 25 and there was no way around it sending email directly. I was forced to use my webmail solution (Roundcube) for sending mail. Which is a bit awkward as I was able to read and receive mail using Mail.app.

I started digging around for a solution that might work and I found the most simple and elegant solution that was already available in Postfix. It was called submission (port 587) which only allowes access by authenticated users.

To enable this ready made configuration in Postfix you will need to edit the ‘master.cf‘ file in ‘/etc/postfix/‘. You need to uncomment the following lines and save the changes.

submission inet n – n – – smtpd
  -o smtpd_enforce_tls=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject

Then reload the changed configuration files into postfix with the command:

sudo postfix reload

Most mail clients like Mail.app and Thunderbird are able to use this port without any extra configuration. The only thing you will notice that you are able to send email which would otherwise be blocked.

Hope this will work as well for you as it did for me. I’ve also updated the regular documentation set to include this setting. Also don’t forget to open up this port in your firewall/router configuration.

2 comments

As promised earlier, now Dovecot 1.2.0 is released, I’m officialy launching the new mailserver setup with Postfix and Dovecot (Currently Leopard only).

This means no more Courier based products like the authentication, IMAP, POP3 and maildrop apps. Dovecto can do all that with a single installation. I’ve found out that the setup is a lot simpler with a lot fewer procedures and configuration files to maintain.

An last but not in the least, it looks like Dovecot is proving to be an even better IMAP server than Courier was. As I told you in the earlier post it’s a lot faster. While testing it myself I often saw new email appear in Mail or Thunderbird immidiate after thy were received by Dovecot.

Currently the setup only describes the basic setup of a server, I still need to add the DSpam spam-filter in the setup and integrate server based filtering of incoming emails (where we used to use maildrop for). It is all possible but I still need to find out how and document it for you. When that is done I will write the neccesary migration documents how existing users can migrate safely from Courier to Dovecot.

I will keep supporting the Courier product stack for at least a year after I finished documenting the migration instructions. So don’t worry if you don’t switch immediatly. My production servers still run Courier, I only use Dovecot on my test servers. Although there is one user who has already switched to Dovecot (We helped each other in getting this done) because of the performance problems he experienced with Courier IMAP. These problems are now gone and this is one of the reasons I want to move to Dovecot a.s.a.p.

The advise currently is if you want to setup a new server: Use the Dovecot based setup. If you already use Courier please wait untill the migration instructions are finished. If you can’t wait I will try to assist you via email as much as I can but you will be mostly on your own. It’s not that difficult but ou need to know what you are doing.

I hope you like the switch and will be happy with the improved setup. You can read all about it at the new mailserver instruction pages

1 comment

I’m very sorry this has taken so long. I wanted to make sure I had a good description of the instructions and tested it with most of the applications in use. I think I’ve got it nailed which means this instructions will give you a safe way to upgrade your MySQL version.

But as always with MySQL, make a backup of your data before you start messing with MySQL. I try to do my best at offering you a safe instruction set but I’m unable to foresee any combination of soft and hardware you might have installed so it might not work. You can use mysqldump, phpMyAdmin or any other tool you might use.

Alright, backup ready! Here we go…

First download the new 5.1.x packages, at the time of writing that would be 5.1.34. Download the appropriate package for your platform from the section called: “Mac OS X (package format)”. Then from the bottom section called “Source downloads” download the “Compressed GNU TAR archive (tar.gz)” package.

When you are ready you need to stop your current installation of MySQL, but because we made it foolproof and unstoppable (it will restart automatically) we need to do some extra steps:

sudo launchctl stop com.diymacserver.mysql
sudo launchctl unload /System/Library/LaunchDaemons/com.diymacserver.mysql.plist

Now the old 5.0.x installation of MySQL is stopped and you have a backup ready and waiting we can continue.

Open/Mount the disk-image of the 5.1.x version you just download and install MySQL from there by double clicking the installer and follow the instructions.

When you are finished continue with unpacking the 5.1.x source archive you downloaded as well. CD into the directory and execute the following commands:

For 64 bits on Leopard:
CFLAGS=”-arch x86_64″ \
CXXFLAGS=”-arch x86_64″ \
./configure --prefix=/usr/local/mysql \
--with-server-suffix=-standard \
--enable-thread-safe-client \
--enable-local-infile \
--enable-shared \
--with-zlib-dir=bundled \
--with-big-tables \
--with-readline \
--with-plugins=all \
--without-docs

For 32 bits on Leopard:
./configure --prefix=/usr/local/mysql \
--with-server-suffix=-standard \
--enable-thread-safe-client \
--enable-local-infile \
--enable-shared \
--with-zlib-dir=bundled \
--with-big-tables \
--with-readline \
--with-plugins=all \
--without-docs

I’m still working on Tiger but my old Tiger based G4 mini has died and I need to revive it again. Sorry

Followed by:

make
sudo make install

Now to restore all your databases we can do two ways: Quick and dirty or clean. Both will work, but you will need to check your users and passwords afterwords.

Quick and dirty:

Copy the data directory from your 5.0.x installation to the new mysql/data directory.

sudo cp -R /usr/local/mysql-5.0.81-osx10.5-x86_64/data /usr/local/mysql
sudo chown -R _mysql /usr/local/mysql/data/*

Clean:
Startup MySQL and import your backup.

To startup MySQL you can just re-enable the lauchd commands:

sudo launchctl load /System/Library/LaunchDaemons/com.diymacserver.mysql.plist
sudo launchctl start com.diymacserver.mysql

All should be fine.

7 comments

Finally, I’ve set myself to it after avery busy week at work. I’ve created a new set of pages to instruct you how to compile Postfix, Courier-Auth and Courier IMAP/POP3 in 64 bits mode. It’s basically setting some extra compiler flags but it takes some trial and error to find out which are the correct ones. Don’t forget you need a 64 bits MySQL installation to get this working otherwise you will get compiler errors.

The configuration of all the components is not affected by this new compilation method so they stay the same. Next up: DSPAM and Maildrop.

3 comments

I’ve received many requests to add several modules to my documentation set of installing PHP. I’ve untill now avoided it because it is a lot of work to do this for all seperate versions. Not even mentioning solving issues and supporting all your questions.

I’ve now documented how to add GD (which was one of the most requested modules) and mcrypt (required for a safe use of phpmyadmin).

I’ve documented each module as a seperate installation and it will tell you which parameters to add to the normal PHP installation to make it work. In this manner everyone can select the modules he or she wants without the modules that aren’t needed.

Read more about it on their respective pages:

I hope you like this method of documention this.

no comments

It looks my earlier findings were a bit premature. I’ve been given access to a Core2Duo Mac mini by Ceriel of Vakantieland.nl and Crashplan.nl to test the findings I had when compiling the MAMP stack in 64 bits. There are some minor differences in compiling MySQL and PHP as the earlier solution does not work for them.

Apache:
CFLAGS="-arch x86_64" \
./configure --enable-layout=DIYMacServer \
  --enable-mods-shared=all \
  --with-ssl=/usr \
  --with-mpm=prefork \
  --disable-unique-id \
  --enable-ssl \
  --enable-dav \
  --enable-cache \
  --enable-proxy \
  --enable-logio \
  --enable-deflate \
  --with-included-apr \
  --enable-cgi \
  --enable-cgid \
  --enable-suexec

MySQL:
CFLAGS="-arch x86_64" \
CXXFLAGS="-arch x86_64" \
./configure --prefix=/usr/local/mysql \
  --localstatedir=/usr/local/mysql/data \
  --libexecdir=/usr/local/mysql/bin \
  --libdir=/usr/local/mysql/lib \
  --with-server-suffix=-standard \
  --enable-thread-safe-client \
  --enable-local-infile \
  --enable-shared \
  --with-zlib-dir=bundled \
  --with-big-tables \
  --with-readline \
  --with-archive-storage-engine \
  --with-innodb \
  --without-docs \
  --without-bench

PHP:
CFLAGS="-arch x86_64" \
CXXFLAGS="-arch x86_64" \
./configure --prefix=/usr/local/php5 \
--mandir=/usr/share/man \
--infodir=/usr/share/info \
--sysconfdir=/etc \
--with-zlib \
--with-zlib-dir=/usr \
--with-openssl \
--without-iconv \
--enable-exif \
--enable-ftp \
--enable-mbstring \
--enable-mbregex \
--enable-sockets \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-apxs2=/usr/local/apache2/bin/apxs

In Leopard there is a problem with the iconv library, somehow that is not 64 bits or something like that. When compiling 32 bits it works. I guess if you really want iconv you will have to recompile the inconv library to get that one working. Currently I’m working to get IMAP working for postfixadmin.

no comments

Some of you have the “luxury” of having Macs with Core 2 Duo processors. I’m still working on my Core Duo Mac mini so this post isn’t really for me. But if you have one of those Macs who are capable of running 64 bit software than this post is for you.

To compile MySQL, Apache or PHP you need to add a compiler flag to the ./configure statement and that is it.

CFLAGS=”-arch x86_64″ \
./configure etc…

(Note: this is only valid for Intel CPU’s, in case of a PowerPc use ppc_64)

I do not know how this would influence performance as I can’t run 64 bit apps. If someone would test the difference and comment their findings here that would be great.

To find out if you’ve got the capability of running 64 bit applications I found this simple test. Open a Terminal session and execute the following command:

httpd -V

In the output you should find a line with:

Architecture: 64-bit

if you have got a 64 bit version or

Architecture: 32-bit

if you have a 32 bits system just like me.

By the way I’m planning for a new Mac before the end of the year. Still need to decide what model but I’ve started saving up for it, care to help ?

2 comments

When I tested the latest MySQL upgrade I noticed I had left out some of instructions that accompany the other applications. So this weekend I wrote the pages “Upgrading MySQL” and “Starting MySQL on Leopard” which makes sure that MySQL is started automatically after a reboot using the new launchd program. With this you don’t need to install the MySQL startup item, it will only interfere. The new launchd scripts is also configured to automatically restart MySQL after a crash, shutdown or other failure.

no comments

Sam Varshavchik has released an upgrade to the Courier-Auth daemon and the Courier-IMAP server.

Courier-Auth upgraded to 0.61.0 this release has the following changes:

  • Implement stubs for the SASL EXTERNAL authentication method.
  • Switch to versionless shared libraries. Install all shared libraries just as .so. make install manually removes *.so.0.0 files that were left over from previous versions, and installs a temporary *.so.0 symlink to *.so, for temporary binary ABI compatibility with 0.60. The symlinks will be removed in 0.62.

To upgrade your courier-auth installation read “Upgrading Courier-Auth

Courier-IMAP was upgraded to 4.4.0 and a small configure bug was found and a few days later 4.4.1 was released which compiles without a problem.

  • Optimizations to IMAP keywords. A trade-off with concurrency: faster speed in exchange for a race condition if two concurrent sessions attempt to update keywords on the same message — the last one wins.
  • Add a POP3 login timeout.
  • Fix parsing of backslashes in address fields.
  • Implement SSL certificate based authentication.
  • Fix minor issues with SSL/TLS session caching

To upgrade your courier-IMAP installation read “Upgrading Courier IMAP

no comments

Next Page »