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.

So I have 2 different domains hosted on different servers.

domain1.com is hosted on Windows:
- DNS(MS) is 10.1.1.39
- WEB(MS) is 10.1.1.21
- Exchange(MS) is 10.1.1.180

domain2.com is hosted on Linux. All running from one box 10.1.1.41

Now I can receive mail from domain1.com to domain2.com, but I cannot send from domain2.com to domain1.com. 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[127.0.0.1]
Apr 26 13:46:42 ns1 postfix/smtpd[4820]: A2D37101E78: client=unknown[127.0.0.1]
Apr 26 13:46:42 ns1 postfix/cleanup[4808]: A2D37101E78: message-id=
Apr 26 13:46:42 ns1 postfix/smtpd[4820]: disconnect from unknown[127.0.0.1]
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 [127.0.0.1] [127.0.0.1]  -> , 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=127.0.0.1[127.0.0.1]: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([127.0.0.1]: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=, relay=domain1.com[10.1.1.21]:25, delay=0.08, delays=0.06/0.02/0/0, dsn=4.4.2, status=deferred (lost connection with domain1.com[10.1.1.21] while receiving the initial server greeting)

So here is a copy of my Microsoft DNS settings.

Name            Type            Data
(same as parent)    Host (A)        10.1.1.21
(same as parent)    Name Server NS      ns1.domain1.com
ns1         Host (A)        10.1.1.39
mail            Host (A)        10.1.1.180
exchange        Host (A)        10.1.1.180
www         Host (A)        10.1.1.21
mail            Mail Exchanger(MX)  exchange.domain1.com

 DiG 9.7.3-P3-RedHat-9.7.3-8.P3.el6_2.2  domain1.com 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:
domain1.com.          IN      MX

 AUTHORITY SECTION:
domain1.com.   3600    IN      SOA     ns1.Workgroupdomain.domain1.com. hostmaster.Workgroupdomain.domain1.com. 69 900 600 86400 900

 Query time: 1 msec
 SERVER: 10.1.1.39#53(10.1.1.39)
 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 domain1.com it has to use the mail server of mail.domain1.com?

Any help is appreciated.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Postfix is trying to relay mail to 10.1.1.21, 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 mail.domain1.com, so if you sent mail to user@mail.domain1.com it would go to Exchange - but you don't have an MX record for just domain1.com. Add an MX record for @ in domain1.com, pointed at exchange, and you'll be all set. The line will look like
(same as parent) Mail Exchanger(MX) exchange.domain1.com

share|improve this answer
    
Microsoft DNS A 10.1.1.21 –  Paul Murphy Apr 27 '12 at 14:51
    
Here are my Microsoft DNS settings. Microsoft DNS Name Type Data (same as parent) Host (A) 10.1.1.21 (same as parent) Name Server NS ns1.domain1.com ns1 Host (A) 10.1.1.39 mail Host (A) 10.1.1.180 exchange Host (A) 10.1.1.180 www Host (A) 10.1.1.21 mail Mail Exchanger(MX) exchange.domain1.com 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

 
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.