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 a website where the domain uses an external mail server (defined by and the MX record). An example email address is Whenever the server sends a notification email to this user, it gets bounced with a message such as:

to=, relay=local, delay=0.03, delays=0.02/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "johndoe")

because it thinks the destination is localhost instead of Will reconfiguring Postfix take care of this issue? If so, what directives specifically need to be changed/added? And if not, what is the best way to resolve this?

Edit - Added postconf -n output:

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination =, localhost.localdomain, localhost
myhostname =
mynetworks = [::ffff:]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost = 
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes


share|improve this question
Can you please post the output of postconf -n to get better help? – Khaled Dec 18 '10 at 7:55
Sure, thanks. postconf -n output added above. – modulaaron Dec 18 '10 at 20:55
Are you sending the mail into the MTA as well? This looks to me like the 'To' in the envelope is just 'johndoe' and not ''. Also, is 'johndoe' a local account on this machine -- it doesn't look to me that you're doing virtual delivery, so you need to ensure you have accounts for everyone on the box. – jharley Dec 19 '10 at 15:37 is an email address located at, a remote mail server. When I send mail to this address from the web server, the problem is that it looks for this user on the web server localhost instead of on the remote mail server. The web server is only used to send mail - never to receive mail. – modulaaron Dec 19 '10 at 22:11
up vote 0 down vote accepted

Problem solved by changing:

mydestination =, localhost.localdomain, localhost


mydestination =, localhost.localdomain, localhost
share|improve this answer

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.