1 - Purpose of this document ============================ This document describes how to build, install and configure a Postfix system so that it can do one of the following: - Send mail only, without changing an existing sendmail installation. - Send and receive mail via a virtual host interface, still without any change to an existing sendmail installation. - Replace sendmail altogether. 2 - Typographical conventions ============================= In the instructions below, a command written as # command should be executed as the superuser. A command written as % command should be executed as an unprivileged user. 3 - Documentation ================= Documentation is available as HTML web pages (point your browser to html/index.html) and as UNIX-style man pages (point your MANPATH environment variable to the `man' subdirectory; be sure to use an absolute path). The sample configuration files in the `conf' directory have extensive comments, but they may not describe every nuance of every feature. Many files have their own built-in manual page. Tools to extract those embedded manual pages are available in the mantools directory. 4 - Building on a supported system ================================== If your system is supported, it is one of AIX 3.2.5 AIX 4.1.x AIX 4.2.0 BSD/OS 2.x BSD/OS 3.x BSD/OS 4.x FreeBSD 2.x FreeBSD 3.x FreeBSD 4.x FreeBSD 5.x HP-UX 9.x HP-UX 10.x HP-UX 11.x IRIX 5.x IRIX 6.x Linux Debian 1.3.1 Linux Debian 2.x Linux RedHat 4.x Linux RedHat 5.x Linux RedHat 6.x Linux RedHat 7.x Linux Slackware 3.x Linux Slackware 4.x Linux Slackware 7.x Linux SuSE 5.x Linux SuSE 6.x Linux SuSE 7.x Mac OS X server Mac OS X Public Beta NEXTSTEP 3.x NetBSD 1.x OPENSTEP 4.x OSF1.V3 (Digital UNIX) OSF1.V4 aka Digital UNIX V4 OSF1.V5 aka Digital UNIX V5 OpenBSD 2.x Reliant UNIX 5.x Rhapsody 5.x SunOS 4.1.x SunOS 5.4..5.8 (Solaris 2.4..8) Ultrix 4.x (well, that was long ago) or something closely resemblant. 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 % make tidy first. This will get rid of any system dependencies left over from compiling the software elsewhere. 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: % 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. In order to build with non-default settings, for example, with a configuration directory other than /etc/postfix, use: % make makefiles CCARGS=-DDEF_CONFIG_DIR=\\\\\\\"/some/where\\\\\\\" % make That's seven backslashes :-) But at least this works with sh and csh. In order to build Postfix for very large applications, where you expect to run more than 1000 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 In any case, if the command % make produces compiler error messages, it may be time to examine the FAQ document. 5 - Porting to on an unsupported system ======================================= - Choose a SYSTEMTYPE name for the new system. Please use a name that includes the major version of the operating system (such as SUNOS4 or LINUX2), so that different releases of the same system can be supported without confusion. - Add a case statement to the "makedefs" shell script in the top-level directory that recognizes the new system reliably, and that emits the right system-specific information. Be sure to make the code robust against user PATH settings; if the system offers multiple UNIX flavors (e.g. BSD and SYSV) be sure to build for the native flavor, not the emulated one. - Add an #ifdef SYSTEMTYPE section to the central util/sys_defs.h include file. You may have to invent new feature macros. Please choose sensible feature macro names such as HAS_DBM or FIONREAD_IN_SYS_FILIO_H. I strongly recommend against #ifdef SYSTEMTYPE dependencies in individual source files. This may seem to be the quickest solution, but it will create a mess that becomes increasingly difficult to maintain over time. Moreover, with the next port you'd have to place #ifdefs all over the source code again. 6 - Installing the software after successful compilation ======================================================== IMPORTANT: if you are REPLACING an existing sendmail installation with Postfix, you may need to keep the old sendmail program running for some time in order to flush the mail queue. As superuser, execute the following commands (your sendmail, newaliases and mailq programs may be in a different place): # mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF # mv /usr/bin/newaliases /usr/bin/newaliases.OFF # mv /usr/bin/mailq /usr/bin/mailq.OFF # chmod 755 /usr/sbin/sendmail.OFF /usr/bin/newaliases.OFF \ /usr/bin/mailq.OFF In order to install or upgrade Postfix: - Create a user "postfix" with a unique user id and group id. Preferably, this is an account that no-one can log into. The account does not need an executable login shell, and needs no existing home directory. My password file entry looks like this: postfix:*:12345:12345:postfix:/no/where:/no/shell - Make sure there is a corresponding alias in /etc/aliases: postfix: root - Review section 12 of this file, and decide if a world-writable maildrop is OK, or if Postfix needs a set-gid posting agent. - Run the INSTALL.sh script as the super-user: # make install (interactive version, first time install) # make install