Skip to main content



This cheat sheet provides a quick reference for some common Postfix commands and concepts. Postfix is a popular open-source mail transfer agent (MTA) used for routing and delivering email on Unix-like operating systems.

Postfix Concepts

Postfix Configuration Files

Postfix configuration is defined in various configuration files located in /etc/postfix/.

  • Edit the main configuration file:

    sudo nano /etc/postfix/
  • View the content of the main configuration file:

    cat /etc/postfix/

Basic Postfix Commands

  • Start Postfix service:

    sudo service postfix start
  • Stop Postfix service:

    sudo service postfix stop
  • Reload Postfix configuration:

    sudo service postfix reload

Virtual Domains

Postfix can handle virtual domains and multiple email domains.

  • Configure virtual domains in

    virtual_alias_domains =
  • Define virtual alias mappings in

    virtual_alias_maps = hash:/etc/postfix/virtual

Email Forwarding

Postfix can forward emails to other addresses.

Relaying and SMTP Authentication

To allow relaying and SMTP authentication for external