LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 04-25-2006, 04:16 PM   #1
BillStoll
LQ Newbie
 
Registered: Apr 2006
Posts: 6

Rep: Reputation: 0
using sendmail from one internal server to another


We have two internal servers running linux. One is our mail server running RedHat 7.3, and has been working fine for years, sending and receiving email internally and externally. The other is a file server running Red Hat Enterprise Linux ES release 4 (Nahant Update 3).

We want to be able to have applications on the file server send emails to users on the mail server. For now we are just using the mail command to test. All attempts result in timeout messages in the file server maillog.

For example, I send a test email to bill@foo.com. The file server maillog says that the message is accepted for delivery, but then after a minute it says:

stat=Deferred: Connection timed out with mailserver.foo.com

On the mail server side, we see the error:

NOQUEUE: fileserver.foo.com [x.x.x.x] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA

I have spent a few hours googling the latter error, but no joy yet. Can anyone shed some light?

Thanks,
Bill
 
Old 04-25-2006, 05:53 PM   #2
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora 16
Posts: 160

Rep: Reputation: 43
The message on the mail server looks like what you get when setting up a mail client and you hit "check available authentication mechanisms". The file server looks like it found the mail server OK (DNS MX records OK etc.) and it looks like the file server managed to send HELO/EHLO, then just stopped. Could it be authentication? Something in the mail server access.db? Reverse lookup on the file server IP? Might be worth a tcpdump mission to look at the actual conversation and try to home in on the problem.

By money would be on a DNS issue. Something like the mail server not being able to resolve the IP address of the file server before the file server sendmail times out and drops the connection. Which DNS server will the mail server query, and will it have both forward and reverse records for the file server? Other clients are probably already catered for with dynamic DNS over DHCP or the like but the file server is probably a static IP that has never needed a reverse, PTR record until now. Try a 'dig -x x.x.x.x' on the mail server for the file server IP to see if it gets the right result or times out.

Happy huntin'

--DaveG
 
Old 04-27-2006, 11:32 AM   #3
BillStoll
LQ Newbie
 
Registered: Apr 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Hi Dave,

The mailserver's access.db is pretty simple:

localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY


According to the mailserver's nsswitch.conf, the /etc/hosts file should be used first for name resolution:

hosts: files dns

Our /etc/hosts has an entry for the fileserver:

x.x.x.x fileserver.foo.com fileserver

so I would think reverse lookup would have no trouble. I tried a ping from the mailserver to fileserver.foo.com and it connected instantly and worked fine.

Certainly if the mailserver were to rely on DNS to find fileserver.foo.com it would fail - the world doesn't know about our fileserver - I'm sure no reverse PTR records exist out there.

The dig -x x.x.x.x came back instantly:

# dig -x x.x.x.x

; <<>> DiG 9.2.1 <<>> -x x.x.x.x
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 34862
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;x.x.x.x.in-addr.arpa. IN PTR

;; Query time: 159 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Apr 27 11:24:01 2006
;; MSG SIZE rcvd: 45


That SERVFAIL status and ANSWER: 0 seem to suggest that DNS failed, but again not sure why DNS is involved. Our mailserver is configured as a DNS server (so MAPS RBL+ will work) - perhaps I need to configure it to know about the fileserver - but again don't see why.

I'm probably betraying my relative newbieness to sendmail and DNS

Thanks for taking the time to think about my problem.

Bill
 
Old 04-27-2006, 01:01 PM   #4
BillStoll
LQ Newbie
 
Registered: Apr 2006
Posts: 6

Original Poster
Rep: Reputation: 0
progress...?

I was able to get a message through, but I had to cripple my mailserver to do it

The problem seems to be with our oddball network configuration.

Our interface with the outside world is a little unusual:

Cisco Router ->
Mikrotik Router ->
Subnet with mailserver
Subnet with fileserver
The computer with the Mikrotik software router has three NICs - one to the Cisco, one to the mailserver, and one to the fileserver and the rest of our internal network.

The Mikrotik router has a NAT rule to change the IP address by which the world knows our mailserver (e.g., A.B.C.D) to the address by which our internal network knows it (10.10.10.1). There is no similar NAT rule for traffic originating in the internal network.

When the fileserver sends an email to bill@foo.com, I want it to be smart enough to send it to bill@10.10.10.1. However, it tries to send it to bill@A.B.C.D. I cannot traceroute A.B.C.D from my fileserver - it hangs at the Cisco Router. I am not sure why, but I think it has to do with my NAT rules.

I temporarily added two NAT rules to the Mikrotik so that packets originating in the internal network and addressed to A.B.C.D are NAT'd to 10.10.10.1, and packets from the mailserver to the internal network are NAT'd from 10.10.10.1 to A.B.C.D. I was able to send the email (yay!), but it of course broke every computer that tried to connect to the mailserver using 10.10.10.1. The mailserver's NAT'd response would say it was A.B.C.D when PC was expecting 10.10.10.1, and connection could not be established.


So I seem to have two approaches for fixing the problem. (1) get my fileserver to resolve foo.com as 10.10.10.1, or (2) change all hundred-odd computers on my internal network to POP3 over using mailhost of A.B.C.D instead of 10.10.10.1.

Not sure if (1) is possible, but it sure looks easier.

Thanks again if you got this far
Bill
 
Old 04-27-2006, 02:18 PM   #5
BillStoll
LQ Newbie
 
Registered: Apr 2006
Posts: 6

Original Poster
Rep: Reputation: 0
still struggling...

A few other things...

My /etc/host.conf is order hosts,bind

My fileserver's /etc/hosts file has my mailserver defined:

10.10.10.1 mailserver.foo.com mailserver mailhost

nslookup apparently goes straight to DNS for the info, bypassing /etc/hosts:

nslookup mailserver.foo.com
Server: x.x.x.x
Address: x.x.x.x#y

Non-authoritative answer:
Name: mailserver.foo.com
Address: A.B.C.D


My reading suggests that sendmail resolves names by doing a gethostbyname(), which should use /etc/nsswitch.conf to decide how to go about it. On my fileserver, it should check /etc/hosts before going to DNS. I don't know why sendmail insists on trying to send to A.B.C.D instead of 10.10.10.1 as my /etc/hosts file has said.

Ok I am going to stop posting for awhile

Thanks,
Bill
 
Old 04-27-2006, 02:57 PM   #6
BillStoll
LQ Newbie
 
Registered: Apr 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Hah! I figured it out!!

Added these lines to my mailertable

.foo.com smtp:[10.10.10.1]
foo.com smtp:[10.10.10.1]


and rebuilt mailertable.db with

makemap hash mailertable.db <mailertable


This apparently bypasses sendmail's hunger for MX records.

http://linuxgazette.net/issue31/tag_maildns.html was the link that led me to mailertables and my solution.

Thanks again,
Bill
 
Old 04-27-2006, 06:05 PM   #7
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora 16
Posts: 160

Rep: Reputation: 43
Just checked my e-mail...

Er, looks like you figured that one out all by yourself. Glad to be of any help whatsoever, if any, no problem. I think I can follow what happened - NAT, DNS, sendmail looking for MX records, no reverse records in /etc/hosts. Solution - mailertable. The only other option I can think of would be to add MX and PTR records to the DNS server, but that needs to be maintained, DHCP fixed hosts, etc. ... If it works, why tinker?

All the best,

--DaveG
 
Old 04-30-2006, 10:13 AM   #8
BillStoll
LQ Newbie
 
Registered: Apr 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Thanks Dave - your ideas helped direct me to the solution.

Bill
 
  


Reply

Tags
error, sendmail


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
Sendmail as SmartHost to route MS exchange 2003 Internal mail cksoo Linux - Enterprise 4 01-15-2007 11:34 AM
another sendmail question, internal name RedHat123 Linux - Networking 5 04-08-2005 04:25 PM
Sendmail unable to send to internal addresses Nico Linux - Networking 3 09-19-2003 07:03 PM
internal web server wants out Heaven_Hell Linux - Networking 1 06-12-2003 02:04 PM
smtp internal network 192.168.x.x sendmail sloboda Linux - Networking 0 10-03-2001 05:41 PM


All times are GMT -5. The time now is 12:32 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration