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

So I have 2 different domains hosted on different servers. is hosted on Windows:
- DNS(MS) is
- WEB(MS) is
- Exchange(MS) is is hosted on Linux. All running from one box

Now I can receive mail from to, but I cannot send from to I have a LAMP server setup running on CentOS 6.2 I am using courier, postfix, and maildrop.

I copied the log file from my LAMP server maillog when I try to send an e-mail from domain2 to domain1

Apr 26 13:46:42 ns1 postfix/smtpd[4820]: connect from unknown[]
Apr 26 13:46:42 ns1 postfix/smtpd[4820]: A2D37101E78: client=unknown[]
Apr 26 13:46:42 ns1 postfix/cleanup[4808]: A2D37101E78: message-id=
Apr 26 13:46:42 ns1 postfix/smtpd[4820]: disconnect from unknown[]
Apr 26 13:46:42 ns1 postfix/qmgr[4452]: A2D37101E78: from=, size=1028, nrcpt=1 (queue active)
Apr 26 13:46:42 ns1 amavis[18113]: (18113-07) Passed CLEAN, MYNETS LOCAL [] []  -> , Message-ID: , mail_id: bGLdfgjwN6y6, Hits: -0.999, size: 597, queued_as: A2D37101E78, 9406 ms
Apr 26 13:46:42 ns1 postfix/smtp[4809]: 39578101E69: to=, relay=[]:10024, delay=9.5, delays=0.12/0.01/0/9.4, dsn=2.0.0, status=sent (250 2.0.0 Ok, id=18113-07, from MTA([]:10025): 250 2.0.0 Ok: queued as A2D37101E78)
Apr 26 13:46:42 ns1 postfix/qmgr[4452]: 39578101E69: removed
Apr 26 13:46:42 ns1 postfix/smtp[4828]: A2D37101E78: to=,[]:25, delay=0.08, delays=0.06/0.02/0/0, dsn=4.4.2, status=deferred (lost connection with[] while receiving the initial server greeting)

So here is a copy of my Microsoft DNS settings.

Name            Type            Data
(same as parent)    Host (A)
(same as parent)    Name Server NS
ns1         Host (A)
mail            Host (A)
exchange        Host (A)
www         Host (A)
mail            Mail Exchanger(MX)

 DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2 MX
 global options: +cmd
 Got answer:
 -HEADER- opcode: QUERY, status: NOERROR, id: 53574
 flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

 QUESTION SECTION:          IN      MX

 AUTHORITY SECTION:   3600    IN      SOA 69 900 600 86400 900

 Query time: 1 msec
 WHEN: Fri Apr 27 12:40:56 2012
 MSG SIZE  rcvd: 112

So looking at the maillog from postfix and these settings I guess the real question I have is..

How do I get postfix to see and use the MX record on the DNS server or create some sort of overide for postfix to know that if it wants to send mail to it has to use the mail server of

Any help is appreciated.

share|improve this question
up vote 1 down vote accepted

Postfix is trying to relay mail to, which is apparently your web server. Make sure you've got an MX record for domain1 pointing to your Exchange server.

Edit: Based on updated DNS information. You've got an MX record for, so if you sent mail to it would go to Exchange - but you don't have an MX record for just Add an MX record for @ in, pointed at exchange, and you'll be all set. The line will look like
(same as parent) Mail Exchanger(MX)

share|improve this answer
Microsoft DNS A – Paul Murphy Apr 27 '12 at 14:51
Here are my Microsoft DNS settings. Microsoft DNS Name Type Data (same as parent) Host (A) (same as parent) Name Server NS ns1 Host (A) mail Host (A) exchange Host (A) www Host (A) mail Mail Exchanger(MX) Am I missing something? I think that this looks correct. – Paul Murphy Apr 27 '12 at 14:59
That looks right - but you're not getting this information on your CentOS box. What's the output of dig domain1 MX on the CentOS box? (You may want to paste that as an edit rather than in a comment.) – NathanG Apr 27 '12 at 16:34
I have updated my answer based on the new DNS information you've provided. This should get everything working for you. – NathanG Apr 28 '12 at 5:14
NathanG ------ Thank you so much... This has been bothering me for a little while now and just couldn't figure it out but just knew that it would be something simple. ------------ Thank You for your help. – Paul Murphy Apr 28 '12 at 18:18

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.