-   Linux - Software (
-   -   Mail server not sending mail to location defined in MX record (

modulaaron 12-19-2010 05:03 PM

Mail server not sending mail to location defined in MX record

I have an issue with Postfix that likely requires a change in my setup. The issue is this: is an email address located at, a remote mail server and the MX record location of the domain. When I send mail to this address from the web server (, the mail bounces because it thinks that this address is located on the localhost instead of on the remote mail server.

For example, when I run:


sendmail -t < mail.txt
where mail.txt contains:


subject: Test

Test test test

the mail bounces as per /var/log/mail.log:


Dec 19 14:48:52 swan postfix/local[15718]: 211C818B0B: to=<>, relay=local, delay=0.22, delays=0.07/0.01/0/0.14, dsn=5.1.1, status=bounced (unknown user: "johndoe")
My postconf -n output is as follows:


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

Any advice would be most appreciated. Thanks.

never say never 12-19-2010 07:17 PM


mydestination =, localhost.localdomain, localhost
myhostname =


mydestination =, localhost.localdomain, localhost
myhostname =

where host is the hostname of your server. Right now postfix is configured to handle mail for the entire domain. I think that will do it.

never say never 12-19-2010 07:41 PM

To exapnd on my previous post just a bit. "mydestination" are the mail domains that are considered local. I believe this is the root of your problem. "myhostname" is how the server identifies itself. Best to have the hostname or www, something that shows the mail came from your web server, that will help you when it comes to troubleshooting.

modulaaron 12-19-2010 07:57 PM

That fixed it - thank you!

One more issue remains:


Dec 19 17:42:41 swan postfix/smtp[17100]: 3EF6918B0C: to=<>,[]:25, delay=0.26, delays=0.01/0/0.17/0.07, dsn=5.0.0, status=bounced (host[] said: 550-Verification failed for <> 550-The mail server could not deliver mail to  The account or domain may not exist, they may be blacklisted, or missing the proper dns entries. 550 Sender verify failed (in reply to RCPT TO command))
I updated my reverse DNS about an hour ago, so hopefully this will resolve itself if I give it more time.

Thanks again :)

All times are GMT -5. The time now is 03:55 PM.