LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-21-2013, 01:02 PM   #1
mmyles
LQ Newbie
 
Registered: Jun 2009
Posts: 13

Rep: Reputation: 0
Web server sending e-mail to incorrect IP address, bypassing HOSTS file


Hello. I have a web server running Centos 5.9 and Apache. One of our customers has a website that uses either PHP or Javascript to send out e-mails, but then Sendmail does not deliver it to the correct MX address. It appears as though it is ignoring the entry i have in the hosts file.
The MX server it needs to go to is on the same private subnet (192.168.190.x) as this web server, so I have the hosts file pointing mx1.domain.net to the private address.

Here are some examples detailing what I am seeing:

The hosts file shows the mx1.domain.net pointing to the correct private IP
Code:
root@fedweb etc# cat hosts
*Additional entries removed*
192.168.190.13  mx1.domain.net
And Pinging to mx1.domain.net Also brings up the correct IP address
Code:
root@fedweb etc# ping mx1.domain.net
PING mx1.domain.net (192.168.190.13) 56(84) bytes of data.
But the /var/log/maillog shows the e-mail attempting to go out to the Public IP address
Code:
Feb 21 10:06:29 fedweb sendmail[6830]: r1LI4TLF006828: to=<mmyles@domain.net>,
ctladdr=<apache@fedweb.domain.net> (48/48), delay=00:02:00, xdelay=00:02:00, 
mailer=esmtp, pri=120685, 
relay=mx1.domain.net. [123.456.123.456], 
dsn=4.0.0, 
stat=Deferred: Connection timed out with mx1.domain.net.
Is there a setting somewhere that tell Sendmail or Apache to ignore the HOSTS file?

Last edited by mmyles; 02-21-2013 at 02:13 PM.
 
Old 02-21-2013, 01:35 PM   #2
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594

Rep: Reputation: 141Reputation: 141
change host to domain.net
 
Old 02-21-2013, 02:42 PM   #3
mmyles
LQ Newbie
 
Registered: Jun 2009
Posts: 13

Original Poster
Rep: Reputation: 0
I'm sorry, your reply seemed kind of vague. Where would you want me to make this change?
 
Old 02-21-2013, 02:44 PM   #4
whizje
Member
 
Registered: Sep 2008
Location: The Netherlands
Distribution: Slackware64 current
Posts: 594

Rep: Reputation: 141Reputation: 141
In your hosts file change mx1.domain.net to domain.net
 
1 members found this post helpful.
Old 02-21-2013, 03:37 PM   #5
mmyles
LQ Newbie
 
Registered: Jun 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by whizje View Post
In your hosts file change mx1.domain.net to domain.net
Not the exact fix, but got me in the right direction. Thank you.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
How to check "incorrect mails" before sending it through my mail server? nishith Linux - Server 2 04-21-2009 07:47 AM
microsoft bypassing hosts file? nowshining General 2 02-22-2009 11:05 AM
Perl/Web (www) server needs to use mail server for sending forms. dskv Linux - Server 4 04-08-2008 12:34 PM
qmail server, local users sending mail with incorrect email addresses HoundDog Linux - Networking 2 01-04-2006 02:40 AM
Sending a file to a web server via ftp mrobertson Programming 11 07-06-2005 09:12 AM

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

All times are GMT -5. The time now is 12:33 AM.

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