preload preload preload preload

Postfix Basic Build

Postfix Basic Build

Compile a Basic Postfix
Once you have downloaded the source code, move it into the /usr/local/src directory, other options are available.

Download Source Code From Here:

http://www.postfix.org/download.html

mv postfix-2.5.5.tar.gz /usr/local/src/

Untar the file which will create a directory.
tar zxvf postfix-2.5.5.tar.gz

Move into the new postfix directory.

cd postfix-2.5.5

Install the prerequisites.  These were required on an Ubuntu 8.04 server.

apt-get install db*-devel

apt-get install libdb-dev

Since Postfix does not use  GNU autotools and so does not have the configure script that you may be used to.  Typically the make utility will use a Makefile that will determine the options you want, dependencies and prerequisites.  Postfix will actually do this work for you by creating it’s own Makefile.

make

Once the compile is complete you will need to create the user and groups for Postfix.

groupadd postfix
groupadd postdrop

The user postfix needs to have an account that cannot log in and be a part of the postfix group that was created.

useradd -c postfix -d /tmp -g postfix -s /bin/false postfix

Now run the final command which will allow you to choose directories and locations that you want to use with your installation.  Read each option closely so that when you run the command you have an idea on what you want to change, if anything.  You can take the default settings by choosing ENTER.

make install

Please specify the prefix for installed file names. Specify this ONLY if you are building ready-to-install packages for distribution to other machines.
install_root: [/]

Please specify a directory for scratch files while installing Postfix. You must have write permission in this directory.
tempdir: [/usr/local/src/postfix-2.5.5]

Please specify the final destination directory for installed Postfix configuration files.
config_directory: [/etc/postfix]

Please specify the final destination directory for installed Postfix administrative commands. This directory should be in the command search path of adminstrative users.
command_directory: [/usr/sbin]

Please specify the final destination directory for installed Postfix daemon programs. This directory should not be in the command search path of any users.
daemon_directory: [/usr/libexec/postfix]

Please specify the final destination directory for Postfix-writable data files such as caches or random numbers. This directory should not be shared with non-Postfix software.
data_directory: [/var/lib/postfix]

Please specify the destination directory for the Postfix HTML files. Specify “no” if you do not want to install these files.
html_directory: [no]

Please specify the owner of the Postfix queue. Specify an account with numerical user ID and group ID values that are not used by any other accounts on the system.
mail_owner: [postfix]

Please specify the final destination pathname for the installed Postfix mailq command. This is the Sendmail-compatible mail queue listing command.
mailq_path: [/usr/bin/mailq]

Please specify the destination directory for the Postfix on-line manual pages. You can no longer specify “no” here.
manpage_directory: [/usr/local/man]

Please specify the final destination pathname for the installed Postfix newaliases command. This is the Sendmail-compatible command to build alias databases for the Postfix local delivery agent.
newaliases_path: [/usr/bin/newaliases]

Please specify the final destination directory for Postfix queues.
queue_directory: [/var/spool/postfix]

Please specify the destination directory for the Postfix README files. Specify “no” if you do not want to install these files.
readme_directory: [no]

Please specify the final destination pathname for the installed Postfix sendmail command. This is the Sendmail-compatible mail posting interface.
sendmail_path: [/usr/sbin/sendmail]

Please specify the group for mail submission and for queue management commands. Specify a group name with a numerical group ID that is not shared with other accounts, not even with the Postfix mail_owner account. You can no longer specify “no” here.
setgid_group: [postdrop]

This should complete a basic setup for Postfix and you can then start postfix with:

/usr/sbin/postfix start

You should see port 25 listening when you run netstat.

netstat -aunt