Postfix & Dovecot
I have OS X 10.10.3 on a Mac Mini.
If your installation varies, then probably so will a few other things. For example, your installed version. Check this with
robert$ postconf mail_version
It will return your currently running version. As of 11th April, 2015, the version is 3.0.0, downloadable from here http://www.postfix.org/documentation.html
I’ve done a find on anything postfix, just to check here.
robert$sudo find / -name postfix -print
Ok, download your postfix-3.0.0 into your Downloads directory, and unpack it there. if you DON’T want to over write your existing version of Postfix, just do the make – DO NOT DO “make install”….
Change into that directory.
zeus:~ robert$ cd Downloads/postfix-3.0.0
zeus:postfix-3.0.0 robert$ ls -l
zeus:postfix-3.0.0 robert$ make
zeus:postfix-3.0.0 robert$ sudo make install
ends with this. Accept all defaults unless you REALLY know what you are doing.
postfix: Postfix is running with backwards-compatible default settings
postfix: See http://www.postfix.org/COMPATIBILITY_README.html for details
postfix: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
Note: the following files or directories still exist but are
no longer part of Postfix:
Then, when all is done, do
zeus:postfix-3.0.0 robert$ postconf mail_version
mail_version = 3.0.0
Next, install Dovecot. A little bit more complex, but not too bad.
============================ check existing paths ===================
zeus:~ robert$ echo $PATH
Download the latest Dovecot sources – from http://dovecot.org/download.html
Go to the instructions. http://wiki2.dovecot.org
Then go to Compiling From Sources here: http://wiki2.dovecot.org/CompilingSource
These are the steps. Compiling can take a fairly long time, so don’t rush it. My Mac Mini has 16GB of RAM and a 7200rpm hdd, and and i7Processor, so it’s fairly fast, but if you have limited RAM, your waiting times may be much longer. It doesn’t matter, just be patient.
When it’s finished – check for ERRORS. There shouldn’t be any if you have the latest Yosemite installed (10.10.3 as of this build)
I’ve unpacked the sources in the download directory, into their own directory called dovecot-2.1.17 (the release I’m using now)
Do the following steps
zeus:dovecot-2.1.17 robert$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
............ and so on for many pages of checking and building. With no errors, it should get to here.....
config.status: creating dovecot-config.in
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
Install prefix . : /usr/local
File offsets ... : 64bit
I/O polling .... : kqueue
I/O notifys .... : kqueue
SSL ............ : yes (OpenSSL)
GSSAPI ......... : no
passdbs ........ : static passwd passwd-file pam checkpassword
: -shadow -bsdauth -sia -ldap -sql -vpopmail
userdbs ........ : static prefetch passwd passwd-file checkpassword
: -ldap -sql -vpopmail -nss
SQL drivers .... :
: -pgsql -mysql -sqlite
Full text search : squat
: -lucene -solr
============================ end of configure ===========
The first “Make”
...... pages and pages ....
...... finally .......
Making all in wiki
make: Nothing to be done for `all'.
Making all in example-config
Making all in conf.d
make: Nothing to be done for `all'.
cat ./README.in | sed "s|@exampledir@|/usr/local/share/doc/dovecot/example-config|" > README
make: Nothing to be done for `all-am'.
============================= end of make =================
Now, to install it. Still following the instructions…. REMEMBER to do sudo, or it WILL break.
zeus:dovecot-2.1.17 robert$ sudo make install
Making install in .
/bin/sh ./update-version.sh . .
././install-sh -c -d /usr/local/lib/dovecot; \
...... lots of stuff .......
...... finally it finishes ......
make: Nothing to be done for `install-exec-am'.
.././install-sh -c -d '/usr/local/share/doc/dovecot'
/usr/bin/install -c -m 644 documentation.txt securecoding.txt thread-refs.txt mkcert.sh dovecot-openssl.cnf solr-schema.xml '/usr/local/share/doc/dovecot'
========================== finished sudo make install ===============
The next bit of the instructions may take some figuring out, and seems to say in the detail, that you can change these users mentioned. Use the dovecot.cf settings shown below.
You’ll need to create two users for Dovecot’s internal use:
dovenull: Used by untrusted imap-login and pop3-login processes (default_login_user setting).
dovecot: Used by slightly more trusted Dovecot processes (default_internal_user setting).
Both of them should also have their own dovenull and dovecot groups. See UserIds for more information.
This bit may or may not be tricky, but you can check if you already have such users
$dscacheutil -q group | grep dove
Don’t worry about this too much for now. If you need to actually add them, the log files will tell you.
Check your install went ok.
zeus:sbin robert$ dovecot –version
If you are doing this from scratch – go now, back to http://wiki2.dovecot.org and read
OSX 10.10.3 now has a slightly different way of adding users and groups from the command line.
These steps should outline it. The command is “dscl” – so do a $man dscl or Google it.
There is some additional info in http://www.greenend.org.uk/rjk/tech/useradd.html this post, but you must replace the ‘/’ with a dot. ‘.’ Otherwise it still seems current.
$sudo dscl . -list /Groups | grep dovecot
In my case, it produces this, havingalready createda dovecot group.
robert$ dovecot 500
If you already have a dovecot group, it will show, otherwise – read carefully
You must pick UID and GID yourself. A command like dscl . -list /Groups PrimaryGroupID will produce a list of groups and their IDs, allowing you to avoid existing ones. UIDs above 500 will appear in the account preferences window; those below 501 will not. I don’t know where this is documented, unfortunately.
Remember to use ‘sudo’
To create a group: where GROUP is for example ‘dovecot’
dscl . -create /Groups/GROUP
dscl . -create /Groups/GROUP PrimaryGroupID GID
dscl . -create /Groups/GROUP Password \*
zeus:users robert$ sudo dscl . -create /Users/dovecot
zeus:users robert$ dscl . -read /Users/dovecot
So now you have uses and groups of dovecot and dovenull
However, my predone configuration files shown later in different post may be all you need.
Check what you have so far.
zeus:bin robert$ ./doveconf -n
You should now have an operational latest version of “postfix” and “dovecot”
But they won’t run yet of their own accord.
That requires a couple of LaunchDaemons, and a fair bit of configuration of various files.
I’ll try and get that in a related post soon.