For Postfix and Courier IMAP configuration you need to find out the UID and the GID number for the postfix user on your server (you need the information here and here in our ISP in a box project). Because of rights management and permissioning both Postfix and Courier IMAP need the correct user and group id to access the virtual maibox directory. The information is not in the default User management System Preference panel as postfix is a system user and not a ‘normal’ user. (more…)
Again I made some small progress in getting a fully functional IMAP based mail server running on my Mac mini. After getting Postfix compiled with MySQL support I needed to get started on the IMAP end of things.
First downloading the source code as I couldn’t find any ready made packages I could just install. You can get Courier IMAP from here and the authentication library from here. I used version 4.0.6 of the IMAP server and version 0.57 of the authlib daemon.
The authlib daemon was as easy as ./configure, make and then as root do a ‘make install’ and ‘make install-configure’ and then tweak some of the configuration files. The IMAP server took more effort. It needed some parameters during the configuration stage, I took some values on a best guess effort but I still need to find out what they do exactly. I’ve got it compiled and running with:
./configure --prefix=/usr/local --with-authpwd=YES --without-authcram make make install
Now I can read my emails from the server, still needed some configuration tweaking but more on that later. Still while trying to send mail to myself the mail address gets bounced in Postfix, I need to find out why. But to end on a positive note, my mail was copied into the send mail folder on the IMAP server !
Finally found some spare time to have a look at how to compile Postfix on my Mac mini. When looking around for information on configuring Postifx on the Mac I also bookmarked all the information regarding compiling Postfix. Most of the info I found was out of date or targeted older versions. So I had to combine and try out what still worked and what not.
By the way this is just a quick write down on the things I found out, it’s not a complete guide. I’m planning to write a step by step guide on how to compile and configure a proper Postfix mail server on your Mac mini.
Via some backdoor (can’t remember how I found it) located this article on AFP548.com. It’s for an older version of Postfix and OS X (panther) but it’s got some nice pointers on the stuff you have to do. You have to remember that I’m not an Unix guru and just have fumbled my own current Postfix installation into a working environment. This time it’s going to be a repeatable effort and I’m looking for all the info I can get.
I’m including PCRE into the Postfix build as well as it’s faster than regexp for contect filtering. I’m not sure if I’m going to use this but it was quite easy to do. It was as simple as downloading the source from http://www.pcre.org/, extracting, running ./configure, make and make install. Done.
Installing SASL was a bit more complex because of the compiler errors I got when trying to compile the latest release. But to cut a long story short, I got it compiled when using version 2.1.18 of the source. I’ve still got to find out which is the latest version that compiles without a problem.
Compiling Postfix was also not nuch of a problem. Just getting the latest version of the source (2.2.5 in this case) and getting the first make command working with the options needed. We wanted MySQL support (what all this effort was about) and include PCRE ad SASL. So you end up with a command looking like:
make -f Makefile.init makefiles \ CCARGS='-DUSE_SASL_AUTH -I/usr/local/include/sasl \ -DHAS_MYSQL -I/Library/Mysql/include/mysql' \ AUXLIBS='-L/usr/lib -lldap -L/usr/lib -llber -L/usr/lib -lsasl2 \ -L/Library/MySQL/lib/mysql -lmysqlclient -lz -lm'
If the above make command worked for you then issue it, followed by a make and make update command and everything should be up to date and installed. To check if we got MySQL tables in this version run the following command and look for MySQL in the output:
# postconf -m btree cidr environ hash mysql pcre proxy regexp static unix
Next step is the IMAP server and configuration but that is for another time, now I’m happy I got this done. Just taking one step at a time.
I’ve been trying to get Postfix with IMAP folders working on my Mac mini for some time now. I even got to the point where I was willing to spend money on the Postfix Enabler just to get it working. But yesterday I found out why this isn’t going to work for me, it’s all about user authentication and management. It seems that Postfix and UW IMAP (the IMAP implementation from the Univesity of Washington) are build with Apple’s idea of user management. Which means that each user of my mail server must be created as an actual user on the Mac mini and can not be authorized or managed by a seperate administration.
I found this out while having a talk with Bernard Teo from CutEdgeSystems.com on if the postfix enabler supported virtual domains. Bernard was and is one of the fastest email responders I ever encountered when asking support on a piece of software, he responded within 5 minutes. He explained that, despite claims in several forums that it wouldn’t work, I could configure virtual domains with the Postfix enabler as long as each user on each domain had a seperate mailbox and that was not what I was looking for. I want mailboxes for as many users as it takes while having just one user enabled on my Mac. It’s going to be a web server for many small domains and I want to be able to handle the e-mail traffic for all those domains with a minimum of hassle like I have on my current Debian servers.
I now will start looking for the best place to get the source code for Postfix with installation and configuration help. I guess that now I’m going to compile it I will use all the other features I wanted to use from the beginning like MySQL support and for the Courier IMAP server , which in turn would mean that I can provide web based email services using SquirrelMail.
Wish me luck…
Bummer, I thought it was included in the default package, but somehow the configuration I used (copied from my Sun) didn’t work. I got an error message:
postfix/pickup: fatal: unsupported dictionary type: mysql
I started googling the error message and to find out how I could see which kind of lookup tables are support in the default package installed in OS X. The command I found and used was:
The result was that the following tables are supported:
static sdbm cidr regexp environ proxy btree unix hash
Next I will start the configuration process again from scratch to see if I can get it all working via configuration files. I hope I can get the IMAP folders working, I thought that was supported.
I can off course get the sourcecode for Postfix and recompile the whole thing to get everything working as I wanted (with MySQL support for instance) but I really would like to use standard software and not go out and compile everything myself. If someone knows of a standard package I can install like the packages for Apache, MySQL and PHP please let me know !
I remember I had a hard time configuring Postfix on my Sun running Debian Linux, all those loose config files which don’t make a lot of sense from the beginning. On top of that I wanted IMAP folders (easier to use web based mail and use multiple computers to read mail), virtual domains and use MySQL for account administration. It took me quite some time but I got it done, with lots of espresso and some major googling on error messages and configuration.
There are a lot of HowTo’s and FAQ files to be found on the internet, each for a specific configuration and a specific operating system. Just have a look at postfix.org’s document section to see some of the “official” ones. There are more just google for them.
I tried to collect some information on using and configuring Postfix on OS X but it is hard to come by. When asking around I got pointed to the Postfix Enabler which is a great solution if you’d want a simpel server with one domain, but as far as I could see it doesn’t work if you’d want to setup multiple domains.
Others suggested to install OS X server, it’s got the same basic software installed, but it comes with nice GUI based tools for configuring it all. A shame they can’t be downloaded somewhere. I’m not going to go the server route, not on my Mac mini, maybe later on a true Xserver.
I’m now even more determined to get it working on the Mac just the way I want it done. I’ve got most sites covering this bookmarked to keep googling to a minimum. I’m going to document as much as possible and put it on this site so others can benefit from my expirience doing this. I hope it will help others to get it running in a shorter time frame than I will.
Keep coming back for more info on the subject. I will publish any progress I make.
While I was looking around on my disk where to change the default Apache configuration after I found out that it is installed per default on OSX and I just needed to activate it in the System Preferences / Sharing panel. Click on Personal Web Sharing and you’re off.
More information on how this works and how to configure Apache can be found here. That is not what this blog entry was about.
Looking for the httpd.conf file where you configure your Apache webserver I found 2 entries in the filesystem. One was in /etc/httpd/ where you’d expect it as a regular Linux/Unix user but there is also one to be found in /private/etc/httpd/. So which was I to use ?
After some Googling and looking closer at the directory entries, I found out that /etc is a symbolic link to /private/etc and therefore the same directory. So actually there is only one httpd.conf that is used.
It seems that this has been done to provide compatibility between the unix roots and the OSX’s own layout of the filesystem which has its origin in NeXT.
I always used Putty, a great SSH client for Windows, to connect to my Sun servers securely and safely. You can have a list of connections in a screen and connect wth a click of a mouse button. But I’m trying to use my new Mac for al my tasks so I set out looking for a new “graphical” client to use SSH. I knew that I could do a SSH from the command-line of the Terminal but I found that to cumbersome, you can’t have a list of session. So after some googling I couldn’t find one and went to a forum of Mac users, searched that one and came up empty. So I posted a question in the forum. Got a great tip I’d like to share with you:
- Put the terminal in the dock
- Click and hold the left mouse button on the terminal icon
- In the menu that appears, click on the “Connect to server…” option
- A small window appears where you can manage your SSH connections and connect to any server with a mouseclick, just like I used to do with Putty.
I hope you like this solution as much as I do, if you have another good solution for this leave a comment.