Setting up Postfix on

These are just my personal notes. No warranty whatsoever.

Quickly test whether emails are being sent:

$ echo "the body" | mail -s "the subject"

Consult the mail log:

$ sudo tail /var/log/mail.log

My contains among others:

myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =,,, localhost
virtual_alias_domains = /etc/postfix/vhosts.txt
virtual_alias_maps = hash:/etc/postfix/valias.txt
  • The /etc/aliases file contains manual redirection definitions and aliases generated by mailman:

    # Required aliases
    postmaster:     root
    MAILER-DAEMON:  postmaster
    # Common aliases
    abuse:          postmaster
    spam:           postmaster
    # since 20160807
    ## mailman mailing list
    mailman:              "|/var/lib/mailman/mail/mailman post mailman"
    mailman-admin:        "|/var/lib/mailman/mail/mailman admin mailman"
    mailman-bounces:      "|/var/lib/mailman/mail/mailman bounces mailman"
    mailman-confirm:      "|/var/lib/mailman/mail/mailman confirm mailman"
    mailman-join:         "|/var/lib/mailman/mail/mailman join mailman"
    mailman-leave:        "|/var/lib/mailman/mail/mailman leave mailman"
    mailman-owner:        "|/var/lib/mailman/mail/mailman owner mailman"
    mailman-request:      "|/var/lib/mailman/mail/mailman request mailman"
    mailman-subscribe:    "|/var/lib/mailman/mail/mailman subscribe mailman"
    mailman-unsubscribe:  "|/var/lib/mailman/mail/mailman unsubscribe mailman"
  • The vhosts.txt file contains other domain names hosted on this server, e.g:
  • The valias.txt file contains manual definitions of redirections from vhosts to local user names, e.g.: luc luc

Restarting Postfix

$ sudo service postfix restart

The mail queue

See what’s waiting to be delivered:

$ mailq

Clear the mail queue:

$ sudo postsuper -d ALL deferred