Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to create a forwarding mail account on a Ubuntu system using Postfix.

I have scoured Google and everything I've found seems to point at doing all of this work through MySQL. According to ps -aux | grep mysql, MySQL is not even running. Hence, Postfix must be using some other method for managing such things.

I don't know much about Postfix and not finding straight answers is beginning to fray my patience.

Here's my followed by my virtual file's contents:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =, localhost.localdomain, localhost
relayhost =
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
virtual_alias_domains =
virtual_alias_maps = hash:/etc/postfix/virtual

virtual file,
share|improve this question
So you want one account that forwards all the mail addressed to it somewhere else? Or you want to set up a system where you can create X accounts that all forward mail somewhere else, or where a user can decide to forward mail to gmail one day and yahoo the next and both the third? – DerfK Oct 13 '11 at 16:08
Sorry...There is an installation already on the hosting server. I need to basically create an account on that server that will forward all email to two recipients on remote mail servers. (e.g. forwards to & – Skittles Oct 13 '11 at 16:27
If you have a configuration then why not read the configuration? Or let us see the configuration? Otherwise I have to point you to virtual_alias_maps which does the trick. – mailq Oct 13 '11 at 18:54
Here's my followed by my virtual file's contents: – Skittles Oct 14 '11 at 13:14
up vote 0 down vote accepted

Perhaps you only need to create a line in /etc/aliases:

and then just run sudo newaliases.

It's possible that can be shortened to shop.

share|improve this answer

You're in the right direction, however the layout of your virtual file seems flawed. A hash file looks like this (in your case):

When you're done editing, run postmap <hashfile> to generate the database.

share|improve this answer
Flash, thank you so much for the response. I changed the virtual file as you directed and when I ran postmap, it gave me this error; "postmap: warning: /etc/postfix/virtual, line 1: record is in "key: value" format; is this an alias file?" Should I maybe be using the virtual_maps directive in my instead of virtual_alias_maps? – Skittles Oct 14 '11 at 14:14

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.