Just so that I don’t have to keep looking this stuff up over and over again.

Configure Postfix main.cf

# The host name of the system

myhostname = mail.domain.tld
# The domain name for the email server

mydomain = domain.tld
# The domain name that locally-posted email appears to have come from

myorigin = $mydomain
# Network interfaces that Postfix can receive mail on

inet_interfaces = all
# The list of domains that will be delivered

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
# Trusted IP addresses that may send or relay mail through the server

mynetworks =, xxx.xxx.xxx.xxx/32,
# List of destination domains this system will relay mail to

relay_domains =
# Path of the mailbox relative to the users home directory

home_mailbox = Maildir/

Configure Postfix to listen on custom port

smtp inet n - n - - smtpd


587 inet n - n - - smtpd

Allow SMTP traffic to the custom port

iptables -A INPUT -p tcp -dport 587 -j ACCEPT

Create Aliases

vi /etc/aliases
admin:  root
postmaster: root

View the mail queue


Flush the mail queue

postqueue -f