Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Postfix Documentation
Previous Page Home Next Page

4 - Building on a supported system

At some point in time, a version of Postfix was supported on:

AIX 3.2.5, 4.1.x, 4.2.0, 4.3.x, 5.2
BSD/OS 2.x, 3.x, 4.x
Darwin 1.x
FreeBSD 2.x, 3.x, 4.x, 5.x
HP-UX 9.x, 10.x, 11.x
IRIX 5.x, 6.x
Linux Debian 1.3.1, 2.x, 3.x
Linux RedHat 3.x (January 2004) - 9.x
Linux Slackware 3.x, 4.x, 7.x
Linux SuSE 5.x, 6.x, 7.x
Mac OS X
NetBSD 1.x
OSF1.V3 - OSF1.V5 (Digital UNIX)
Reliant UNIX 5.x
Rhapsody 5.x
SunOS 4.1.4 (July 2006)
SunOS 5.4 - 5.9 (Solaris 2.4..9)
Ultrix 4.x (well, that was long ago)

or something closely resemblant.

4.1 - Getting started

On Solaris, the "make" command and other utilities for software development are in /usr/ccs/bin, so you MUST have /usr/ccs/bin in your command search path.

If you need to build Postfix for multiple architectures, use the "lndir" command to build a shadow tree with symbolic links to the source files. "lndir" is part of X11R6.

If at any time in the build process you get messages like: "make: don't know how to ..." you should be able to recover by running the following command from the Postfix top-level directory:

% make -f Makefile.init makefiles

If you copied the Postfix source code after building it on another machine, it is a good idea to cd into the top-level directory and first do this:

% make tidy

This will get rid of any system dependencies left over from compiling the software elsewhere.

4.2 - What compiler to use

To build with GCC, or with the native compiler if people told me that is better for your system, just cd into the top-level Postfix directory of the source tree and type:

% make

To build with a non-default compiler, you need to specify the name of the compiler. Here are a few examples:

% make makefiles CC=/opt/SUNWspro/bin/cc        (Solaris)
% make

% make makefiles CC="/opt/ansic/bin/cc -Ae"     (HP-UX)
% make

% make makefiles CC="purify cc"
% make

and so on. In some cases, optimization is turned off automatically.

4.3 - Building with optional extensions

By default, Postfix builds as a mail system with relatively few bells and whistles. Support for third-party databases etc. must be configured when Postfix is compiled. The following documents describe how to build Postfix with support for extensions:
Postfix extension Document Availability
Berkeley DB database DB_README Postfix 1.0
LDAP database LDAP_README Postfix 1.0
MySQL database MYSQL_README Postfix 1.0
Perl compatible regular expression PCRE_README Postfix 1.0
PostgreSQL database PGSQL_README Postfix 2.0
SASL authentication SASL_README Postfix 1.0
STARTTLS session encryption TLS_README Postfix 2.2

Note: IP version 6 support is compiled into Postfix on operating systems that have IPv6 support. See the IPV6_README file for details.

4.4 - Overriding built-in parameter default settings

All Postfix configuration parameters can be changed by editing a Postfix configuration file, except for one: the parameter that specifies the location of Postfix configuration files. In order to build Postfix with a configuration directory other than /etc/postfix, use:

% make makefiles CCARGS='-DDEF_CONFIG_DIR=\"/some/where\"'
% make

IMPORTANT: Be sure to get the quotes right. These details matter a lot.

Parameters whose defaults can be specified in this way are:

Macro name default value for typical default
DEF_COMMAND_DIR command_directory /usr/sbin
DEF_CONFIG_DIR config_directory /etc/postfix
DEF_DAEMON_DIR daemon_directory /usr/libexec/postfix
DEF_MAILQ_PATH mailq_path /usr/bin/mailq
DEF_HTML_DIR html_directory no
DEF_MANPAGE_DIR manpage_directory /usr/local/man
DEF_NEWALIAS_PATH newaliases_path /usr/bin/newaliases
DEF_QUEUE_DIR queue_directory /var/spool/postfix
DEF_README_DIR readme_directory no
DEF_SENDMAIL_PATH sendmail_path /usr/sbin/sendmail

4.5 - Support for thousands of processes

In order to build Postfix for very large applications, where you expect to run more than 1000 mail delivery processes, you may need to override the definition of the FD_SETSIZE macro to make select() work correctly:

% make makefiles CCARGS=-DFD_SETSIZE=2048

Warning: the above has no effect on some Linux versions. Apparently, on these systems the FD_SETSIZE value can be changed only by using undocumented interfaces. Currently, that means including <bits/types.h> directly (which is not allowed) and overriding the __FD_SETSIZE macro. Beware, undocumented interfaces can change at any time and without warning.

4.6 - Compiling Postfix, at last

If the command

% make

is successful, then you can proceed to install Postfix (section 6).

If the command produces compiler error messages, it may be time to search the web or to ask the [email protected] mailing list, but be sure to search the mailing list archives first. Some mailing list archives are linked from

Postfix Documentation
Previous Page Home Next Page