Compiling Postfix with IPv6 support under OS X 10.3.x

Introduction

OS X client does come with Postfix but the version you get is a little out of date and does not have IPv6 support. As I wanted IPv6, I ended up rolling my own.

Downloading and Patching the source

Although the developers have been saying for some time that IPv6 support will be rolled into the standard release at some point, you currently have to patch the source yourself. You can download both the Postfix source and the patch for IPv6 here where you can also find instructions on how to apply the patch. However, put simply, you do the following:

NetInfo Support

It seems that NetInfo support is being phased out - both from Postfix and by Apple in OSX. If you have a clean 10.3 intall, you don't seem to receive the NetInfo headers. However, if you have upgraded or have copied the headers over from an older install, you can re-enable NetInfo support (which I use for mail aliases) by editing the makedefs file.

Find the start of the Darwin definition in the makedefs file and comment out the line within the definition that sets the CCARGS. If you want Bind8 compatibility, you might just want to delete the 'no_netinfo' parameter but as 10.3 comes with Bind9 I just commented out the entire line. the # symbol is used to comment out a line.

Configuring the Makefiles

In order to activate TLS and IPv6 support, you need to customise the makefiles using the following line (and note that this is all one line):

make makefiles CCARGS="-DHAS_SSL -DUSE_SASL_AUTH -I/usr/local/include/sasl"
 AUXLIBS="-L/usr/local/lib -lsasl2 -lssl"
            

Patching the Network headers

Starting with 10.3, Apple have modified one of the networking headers to use a const value rather than an integer. This const value is actually defined in a different header and, if you don't include this header, the compile will fail for the postfix utils. This may actually be only something needed if you have IPv6 support - I didn't check.

The problem occurs in the file src/utils/match_ops.c. You need to edit this file to add the line:

#include <arpa/nameser.h>
            

after the first #include <arpa/... line. This will make sure the needed library is included and the compile will succeed.

Compiling and Installing

You should now just have to make / sudo make upgrade (or install). Remember to stop Postfix before you install, just in case.