Kenny Woo

finding new ways to procrastinate.

github twitter linkedin email rss
Forwarding Email using Postfix
Jun 26, 2014
One minute read

Do you have your own domain name? Here’s how you can forward email directed at your domain to another email account (such as Gmail) using postfix.

  • Install postfix (choose “No configuration” during install)
  • Copy template: cp /usr/share/postfix/ /etc/postfix/
  • Add the following to /etc/postfix/
virtual_alias_domains =
virtual_alias_maps = hash:/etc/postfix/virtual
myhostname =
  • Add the following to /etc/postfix/virtual:
# For a specific email, uncomment this line
# For a catch all email, uncomment the line below instead
  • Run postmap /etc/postfix/virtual
  • Restart postfix: sudo service postfix restart
  • Open port 25 on UFW: sudo ufw allow 25

Back to posts