Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

Currently I have installed, and configured postfix. If I send a email to let's say '' I receive the email(s) locally on the server. I would like to get these said emails to 'XYZ' to forward to my gmail account. Currently I have tried adding aliases through postfix to no avail.

Current postfix/

# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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
relayhost =
mynetworks = [::ffff:]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual
home_mailbox = mail/

Current postfix/virtual
share|improve this question
up vote 1 down vote accepted

You already have an alias map created, you can use that. Simply add the following to it:


Then run the newaliases command.

The result should now be that all emails thatshould be delivered to the local account "admin" will be instead forwarded to the specified gmail account.

share|improve this answer
Hi Urgoll, after checking the logs it looks to be working but never receive it in my gmail box? LOG: Jul 31 17:21:28 noble postfix/smtp[3965]: 85930501B9: to=<>, orig_to=<>,[2607:f8b0:400d:c02::1a]:25, delay=0.53, delays=0/0.01/0.07/0.45, dsn=2.0.0, status$ Jul 31 17:21:28 noble postfix/qmgr[3957]: 85930501B9: removed – Starboy Jul 31 '13 at 21:26
Have you checked SPAM folder? [ If messages ACCEPTED by gmail in SMTP session are not delivered at all then report a bug to gmail ] – Andrzej A. Filip Aug 1 '13 at 4:41
Starboy, do a grep of 85930501B9 in your maillog file. Postfix uses a multi-line format, and all lines are required to get the whole picture. – Urgoll Aug 1 '13 at 11:34

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.