Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a website where the domain uses an external mail server (defined by mail.mydomain.com and the MX record). An example email address is johndoe@mydomain.com. 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 mail.mydomain.com. 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 = mydomain.com, localhost.localdomain, localhost
myhostname = mydomain.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/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

Thanks.

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 'johndoe@mycompany.com'. 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
    
johndoe@mycompany.com is an email address located at mail.mycompany.com, 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

1 Answer 1

up vote 0 down vote accepted

Problem solved by changing:

mydestination = mydomain.com, localhost.localdomain, localhost

to:

mydestination = www.mydomain.com, localhost.localdomain, localhost
share|improve this answer

Your Answer

 
discard

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.