Install Postfix

The base package for mail servers is Postfix, which was chosen for its relative ease of configuration. This article provides instructions for installing Postfix and testing the installation.

Note: If you want an email solution that does not require configuring a mail server, consider the Mailgun service. Mailgun provides SMTP and API emails, plus tracking and analytics, which provide insight into how well an email campaign is performing. Additionally, large scale web applications can code against the Mailgun API without maintaining an email server.


These instructions assume that you are using the Ubuntu Hardy OS and that you set it up using our instructions. You must also have completed the basic setup instructions in the following articles:

Install Postfix

  1. Use the aptitude package manager to install Postfix, as well as Telnet and Mailutils, as follows:
    sudo aptitude install postfix telnet mailutils

    Telnet and Mailutils contain several tools that you will use to test and configure Postfix.

  2. When prompted for the general type of mail configuration, select Internet Site.


  3. Enter your main domain name, which should match the host name that you set in Preparing the Cloud Server to be a Mail Server.


You can now send emails from your application. The preparation done in Preparing the Cloud Server to be a Mail Server and this Postfix installation complete the basic setup.

Test the Postfix installation

Although the next article in this series provides more details about sending mail, you can conduct a quick test to verify that Postfix is actually sending mail. Use an email address that is working and for which you can check incoming messages.

  1. Send an email to a working email address of your choice by using the mail command:
  2. When the output asks for the subject of the email, type the subject line and then press Enter.
  3. Enter the body of the email, and then press Enter.
  4. Type a single period (.).

    The period indicates that the body is finished. If that doesn't actually end the message, type Control-D instead.

  5. Press Enter again to send the email. You might have to press Enter twice to skip the CC: entry.

The output for the entire process looks similar to the following example:

Subject: test email from
test body of the email.

You do not receive a confirmation that the email has been sent, although the logs show the details. However, you should check the receiving email address to verify that the email was received.

For many customers, this setup is all you need to send mail from your application, especially if the only emails are notifications to the site administrator. However, the next article provides details about the settings in the Postfix file and what they mean. Working with these settings can help you reduce the chances of your email being classed as spam or your server IP address being blacklisted.

Where to go from here

Basic settings in the Postfix file

© 2015 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER