How to Configure Postfix

If you've ever configured sendmail, you know that it can be very complex and sometimes confusing. Remembering to compile the m4 file before restarting and simply understanding the config file is daunting to even the most experienced Linux administrator.

Postfix, originally developed by IBM, was written to provide an easier alternative to sendmail. While sendmail is still the number one MTA for Linux OS, Postfix's ease of use makes it a good alternative.


  1. Image titled Configure Postfix Step 1
    Diagram your domain and your needs. How many users are you supporting? Will you have a lot of aliases? Many of these types of questions will affect how Postfix is configured.
  2. Image titled Configure Postfix Step 2
    Plan for growth. If you plan on supporting multiple domains, consider using virtual aliases.
  3. Image titled Configure Postfix Step 3
    Decide how you want Postfix to operate. There are three different modes: MTA, Forward, Relay. While they are similar, they operate differently.
    • MTA, or Mail Transport Agent, operates as a normal server, receiving mail on behalf of all users on the computer.
    • Forward is used when addresses to your server will just forward to another address. For example, if you want all mail to your server to forward to your Gmail account, you would setup Postfix to forward your mail.
    • Relay is used as a relay, only accepting mail to be relayed elsewhere. Most ISPs set up their mail servers this way.
  4. Image titled Configure Postfix Step 4
    Modify the file within /etc/postfix. You can review all of Postfix's settings on its official web site.
  5. Image titled Configure Postfix Step 5
    If you need postfix to be able to receive mail on a non-standard port, you must edit This is usually needed by end-users who's ISPs block the standard SMTP port 25
  6. Image titled Configure Postfix Step 6
    Save the configuration file and start postfix.


  • Make sure you have a good understanding of how e-mail works. This is necessary in the event you need to troubleshoot an issue.
  • While postfix supports LDAP, MySQL, and other database aliases, start with a text-based alias file and ensure that your set up works correctly. From there, you can move to a more complex setup.


  • Do not run postfix and another MTA concurrently. This will create a conflict within your system and make the mail server unreachable.

Article Info

Categories: Software