Postfix on Solaris 11

Here’s a recipe for how to install Postfix on Solaris 11. During the process we build Postfix from scratch from source code. Even if you have not previously build any software yourself it should not scare you. It is a matter of following the instructions and it shouldn’t take more than 20 minutes all together.

Starting point

The starting point is a completely fresh install of Solaris 11 using the so called Text Install ISO disk. This is the image I would personally use for a server install – as opposed to a workstation install.

root@myhost:~# cat /etc/release
                           Oracle Solaris 11 11/11 X86
  Copyright (c) 1983, 2011, Oracle and/or its affiliates.  All rights reserved.
                            Assembled 18 October 2011

Furthermore – as most Solaris SysAdmins tend to work inside a zone  -I’ve created the simplest possible zone and will work from within that.
The zone has been created as follows:

root@myhost:~# zonecfg -z pftest
   set zonepath=/export/zones/pftest
root@myhost:~# zoneadm -z pftest install
root@myhost:~# zoneadm -z pftest boot

This about the zone is important as many Solaris folks doesn’t realize that the default template for a zone contains a quite minimalistic set of packages. In other words it may be a package is part of the default Solaris install but that is not the same as the package is also in your zone (which you have created with the default template).

You can read more about zones and what is available in this blog posting. Here you can also see what packages I’ve installed in addition to the default packages.


I’ve downloaded latest Postfix (v2.9.4 at the time of writing) and unpacked it. Remember that when dealing with tarballs which have possibly not been created on Solaris it is always a good idea to use gtar (GNU tar) rather than tar to unpack. (This is why you should always have GNU tar package installed on any Solaris host).

We will compile using the GCC compiler. Make sure you have the required GCC related packages installed.

Ihsan Dogan has published some nice material concerning how to build Postfix for Solaris 10 (look at the bottom of the page). This gave me some hints albeit things are a little different on our target platform: Solaris 11. Also – unlike Ihsan – I’m compiling using GCC compiler.

Here we go: Start by entering into the root of the directory where you have unpacked the source code tarball. Then do the build by doing:

gmake clean
gmake makefiles MAKE=gmake CCARGS='-DNO_NIS -DUSE_TLS -lssl -lcrypto \
    -DDEF_COMMAND_DIR=\"/opt/postfix/bin\" \
    -DDEF_DAEMON_DIR=\"/opt/postfix/libexec\" \
    -DDEF_MAILQ_PATH=\"/opt/postfix/bin/mailq\" \
    -DDEF_MANPAGE_DIR=\"/opt/postfix/man\" \
    -DDEF_NEWALIAS_PATH=\"/opt/postfix/bin/newaliases\" \
    -DDEF_SENDMAIL_PATH=\"/opt/postfix/bin/sendmail\" \
    -DDEF_README_DIR=\"/opt/postfix/readme\" \

Notes to the above:

  • Observe that I consistently use gmake (GNU make) rather than make. This is simply to avoid surprises. Most open source packages have only been tested and verified with GNU make. The are very small differences between GNU make and the Solaris equivalent and the chance that you will ever encounter the difference is 0.001% … but why take a chance ?
  • I start by doing gmake clean. This is obviously not necessary the first time you attempt a build but if you want to repeat the process then you are better off doing a ‘clean’ first. Then you know your starting point.
  • The NO_NIS directive is absolutely required. The build will fail without it. Nobody uses NIS or NIS+ anymore so I’m quite sure you will not need it.
  • The USE_TLS directive is required if you need STARTTLS support. If for example you want to hook up your Postfix server to a SMTP server on the Internet then chances are you will need STARTTLS support.
  • All of the DEF* directives are because I wanted to install Postfix into /opt/postfix and not in anyway be intermingled with the rest of the system and certainly not replace any existing sendmail binaries. You can leave them out if you like but then things will get installed into places like /usr/sbin, /usr/libexec  and /usr/bin and that was not what I wanted.

From this point onwards you can just follow the official Postfix installation instructions. (see Section 6 of that document: “Installing the software after successful compilation”)

Posted in Uncategorized
8 comments on “Postfix on Solaris 11
  1. Jaco Lesch says:

    Upgraded to Solaris 11.1 from 11:
    :~# cat /etc/release
    Oracle Solaris 11.1 SPARC
    Copyright (c) 1983, 2012, Oracle and/or its affiliates. All rights reserved.
    Assembled 19 September 2012

    Since then picked this up in the logs when the server runs a bit of load:
    Feb 26 12:37:57 xxx-ip-smtp-3-1 postfix/qmgr[23016]: [ID 947731 mail.crit] fatal: stream_connect: send file descriptor: Resource temporarily unavailable
    Feb 26 13:11:18 xxx-ip-smtp-3-1 postfix/bounce[29245]: [ID 947731 mail.crit] fatal: stream_connect: send file descriptor: Resource temporarily unavailable
    Feb 26 13:11:18 xxx-ip-smtp-3-1 postfix/qmgr[26140]: [ID 947731 mail.crit] fatal: stream_connect: send file descriptor: Resource temporarily unavailable
    Feb 26 14:18:09 xxx-ip-smtp-3-1 postfix/error[5503]: [ID 947731 mail.crit] fatal: stream_connect: send file descriptor: Resource temporarily unavailable

    Is the a tuning issue in the kernel, or something else maybe?

  2. petersblogwp says:

    Sorry, I don’t know why this happens. Our postfix server is still on Solaris 11.


  3. Jaco Lesch says:

    OK, I had feedback from Wietse regarding this issue and this was one of his suggestions:
    “Install Postfix 2.10 (this no longer uses Solaris streams).”

    Have done this and have resolved the “stream_connect: send file descriptor” issue

  4. muehle says:

    Nice post.
    There ist a ” too many. “/opt/postfix/readme\”” should be “/opt/postfix/readme\”

  5. Amos says:

    Has anybody figured out how to use smtp-notify with SMF using Postfix instead of Sendmail?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: