LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-09-2009, 03:45 AM   #1
JohnRock
Member
 
Registered: May 2009
Posts: 36

Rep: Reputation: 15
Sendmail configuration issue


I have a domain hosted by a 3rd party DNS provider. My mx records for my domain point to their mail servers and I have my email accounts handled by them. I want my Centos production tomcat server to send outgoing mail through sendmail but not receive any incoming mail.

I just changed my A record to point my domain to my production server, and changed my production server hostname to my domain name:
e.g.
hostname=www.mydomain.com

My problem now is this: My server is running sendmail, and when it sends mail to joe@mydomain.com it is now looking for a user named joe on my server and fails if it doesn't find one. If I create a user named joe it will deliver the email into /var/spool/mail/joe.

What I want to happen is for my server's sendmail process to use the mx records located on my 3rd party DNS servers and send the mail to their mail servers so that my server does not have to handle incoming mail.

This was working fine before I changed my server's hostname to the same name as my web domain. That is to say if I send email to joe@mydomain from any other computer it is handled by my DNS server's mail server and my server was behaving that way as well before I gave it the same hostname.

Is there a way that sendmail can send the email to the mail server associated with my domain's mx records even if the email's address is the same as my server's hostname?

I am obviously new to configuring sendmail, and I fear I am missing some important point. I would appreciate any help one can give to clarify this for me.

Thanks!

Last edited by JohnRock; 06-09-2009 at 03:50 AM.
 
Old 06-09-2009, 07:31 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Sendmail by default uses the MX record when it has to deliver email, unless you domain name is listed in /etc/mail/local-host-names. So check that file, remove the line if it exists and restart sendmail.
If your domain name is not listed in local-host-names then I guess you have to configure your mail delivery using virtusertable. Edit /etc/mail/virtusertable and add the following entry:
Code:
@mydimain.com %1@mx-server.mydomain.com
You have to replace mx-server.mydomain.com with the FQDN of your domain's mx server. After editing virtusertable you have to run
Code:
makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable
for the changes to take effect.
 
Old 06-09-2009, 05:13 PM   #3
JohnRock
Member
 
Registered: May 2009
Posts: 36

Original Poster
Rep: Reputation: 15
Thank you for this great direction. I still have one problem:

I modified virtusertable like this:
@mydomain.com %1@smtp.secureserver.net

But now I get this error:
Jun 9 17:11:38 www sendmail[7493]: n59KeSW7007432: to=<joe@mydomain.com>, delay=00:31:10, xdelay=00:00:00, mailer=esmtp, pri=210576, relay=smtp.secureserver.net., dsn=4.0.0, stat=Deferred: Name server: smtp.secureserver.net.: host name lookup failure

I am not sure if that has anything to do with the fact that I just changed the A DNS record to point to my machine only yesterday...I did not change the mx records so I didn't think there would be a problem..

Or might it have to do with this:
sendmail -d60.5 -bv joe@mydomain.com
translates to:
deliverable: mailer esmtp, host smtp.secureserver.net., user joe@smtp.secureserver.net

Wouldn't the user would have to be something like joe@mydomain.com@smtp.secureserver.net?
 
Old 06-09-2009, 05:31 PM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Are you sure that smtp.secureserver.net can be resolved from your end?
How is your domain's zone file in dns? It should be something like that:
Code:
...
IN MX 10 smtp.secureserver.net.
mydomain.com. A 1.2.3.4
www.mydomain.com. A 1.2.3.4
 
Old 06-09-2009, 06:20 PM   #5
JohnRock
Member
 
Registered: May 2009
Posts: 36

Original Poster
Rep: Reputation: 15
Well not exactly sure what you want me to check...The interface I have to manage my MX records on my DNS provider just shows:
0 @ smtp.secureserver.net
10 @ mailstore1.secureserver.net

But I can send outgoing mail through the joe@mydomcain account via smtp.secureserver.net from my home computer (using outlook) fine. It is only on my prod sserver that this is an issue.

But again I wonder could this perhaps simply be because I changed my DNS A record yesterday and the propogation is in flux? Maybe in two more days it will be fine?

Does the mx record require the A record to be fully propagated to resolve correctly?
 
Old 06-10-2009, 12:28 AM   #6
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Since you didn't change the mx record of your domain, it has nothing to do with changing the A record of it. Besides the mx server is in a different domain that you have nothing to do with.

What i cannot understand is, that your server's dns is done by secureserver.net, but it cannot resolve smtp.secureserver.net!!!
The fact that you can send mail from home but not from server happens, because you server thinks that mail to @mydomain.com is local, since you've changed its name. Btw what's in /etc/hosts and what is the output of:
Code:
hostname
host mydomain.com
host www.mydomain.com
 
Old 06-10-2009, 01:12 PM   #7
JohnRock
Member
 
Registered: May 2009
Posts: 36

Original Poster
Rep: Reputation: 15
Thanks so much for your help. Before posting any further I am going to investigate further with my Hosting provider and try to make sure my DNS and reverse DNS and network settings are configured properly. It is very hard to find thorough documentation on this.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail issue (did not issue MAIL/EXPNVRFY/ETRN ...) Blackout_08 Linux - Server 0 08-08-2007 01:10 PM
Sendmail configuration issue brooky9999 Linux - Software 1 08-21-2006 10:05 AM
Sendmail Configuration Issue AquilaHosting Fedora 0 03-30-2005 08:04 PM
sendmail configuration mali Linux - Enterprise 5 03-15-2005 01:15 PM
Sendmail Configuration turishi007 Linux - Software 1 12-16-2004 12:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration