Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail server configuration

Status
Not open for further replies.

symbiotic

Technical User
Jan 17, 2003
28
0
0
GB
Hi all,
I have a mail server setup (sendmail on a slackware box). It works correctly for sending mail through my LAN but I can't send mail to outside domains. Let's say if I try to send mail from my account on my mail server, mymail@myserver.com to myfriend@yahoo.com, I get an error like (using Outlook, but if I use pine I get a similiar message):


"The message could not be sent because one of the recipients was rejected by the server. The rejected e-mail address was "myfriend@yahoo.com" ...
Server Response: '533 5.1.2 <myfriend@yahoo.com>... Unrecognized host name yahoo.com ...&quot;

Is this a setting in sendmail, or maybe the way I have bind configured?
Any help is much appreciated
 
and how would I do that?
I'm sorry, I'm rather a newbie at gnu/linux
 
If you have dig installed on your system, then the command &quot;dig yahoo.com mx&quot; will tell you if your machine will resolve the MX record of the domain.

If you have nslookup available, issue &quot;nslookup&quot;. From the interactive prompt enter &quot;set type=mx&quot; then &quot;yahoo.com&quot;. &quot;exit&quot; will get out out of nslookup. Want the best answers? Ask the best questions: TANSTAAFL!
 
ok figured out how to do it

nslookup
set type=MX

right?
Nope, nothing, shrug, I guess I have to work on configuring bind but it makes no sense, I think it's the most confusing weird thing I've ever tried to do in my life, oh well, I guess I'll gigure it out. I haven't been able to find a guide or faq on it that makes any sense
 
yes.
shouldn't I be? I thought it was necessary to run bind to connect your domain to outside dns's

I thought maybe just now I had fixed it. My resolve.conf had totally wrong nameservers in it, but fixing them didn't seem to fix it. Well, restarting named will restart your resolver, no? If not, then I might need to do that before it will work.
 
No - you don't need bind at all. When you configured your network settings, you put in the dns servers for your isp. You don't really need bind for your lan either unless you're using domain names that are only known to your local net. If you must use bind, be sure to include the root servers so your lan can access the outside world.
 
ok, so if I don't need bind, how can I fix the original problem I had sending mail?
 
Set up DNS resolution in /etc/resolv.conf. Your machine does not know which DNSes to talk to.

Your ISP should have provided you with a list of DNSes you could use. If, for example, they gave you 1.2.3.4 and 5.6.7.8 as a DNS addresses, you should have a lines in /etc/resolv.conf which read:

server 1.2.3.4
server 5.6.7.8
Want the best answers? Ask the best questions: TANSTAAFL!
 
I've done that already.
Should it be
server 1.2.3.4
or
nameserver 1.2.3.4
which is what I have it set as.

Do I need to do something to reload resolv.conf? I read elsewhere that it reloads immediately when changes are made.

Also, if resolve.conf was incorrectly set up, I wouldn't be able to ping or nslookup hostnames, right? I don't think thats the issue


 
I'm pretty sure it's &quot;nameserver&quot;. By the way, you mentioned you were on a lan. What are you using as a gateway? The nameserver should have the internal ip of your gateway/router. Your gateway/router should have the dns server ip addresses given to you by your isp.
 
Sorry, you're right. It's &quot;nameserver&quot;. And the network will immediately use the changes.

Is your network working? For example, the IP of is 18.181.0.31. Can you succesfully ping 18.181.0.31? Want the best answers? Ask the best questions: TANSTAAFL!
 
RhythmAce - Yes, I have a router as a gateway. My resolv.conf originally pointed to that but I changed it to my ISPs DNSs. I guess I will point it back to the router. I don't think it makes a difference though, I can still contact the outside world.

Sleipnir - Yeah I can ping both outside IPs and hostnames.

Thanks you guys, I appreciate you trying to help me out
 
OK, the answer to this sendmail problemo MIGHT be found down a completely different track.
Not pings and pokes or dns stuff.
Has anyone considered that symbiotic's isp might be blocking the mail because it looks like its being relayed by symbiotic's sendmail server. Most isp's block relaying nowadaze. Ask your isp what ya gotta do to get around it. My isp told me wot to do ages ago. I just forgot wot it woz.

ß

 
bluegroper may be right. I think we are going down the wrong road if you can ping the outside world. To get back on the right track, we need to go back to your original problem. You can't send mail to the outside world. Can you receive mail? If not, do you have an &quot;MX&quot; record for your domain? If you do not have a registered domain, you CANNOT send or receive mail using your local domain name because it does not exist as far as the internet is concerned. If you do have the proper dns records setup, such as mail.yourdomain.com pointing to your ip (&quot;A&quot; record) and an &quot;MX&quot; record showing mail.yourdomain.com handles the mail for yourdomain.com, then we can look to see if sendmail is configured to deal with the outside world. Look for a line in sendmail.mc that starts with DAEMON_OPTIONS. You may have 2 of them. You need to delete or comment them out by putting &quot;dnl&quot; in front of them. These will cause sendmail to just work locally. If you edit sendmail.mc, you have to compile a new sendmail.cf. This is done with the following command:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

If this doesn't work, then it could be your ports are blocked. You can scan your ports at the following url:


If you are NOT forwarding these ports on your router, they may show up as &quot;stealth&quot;. You want the ports to show &quot;open&quot; on all the ports you want to access from the internet.
 
&quot;Unrecognized host name&quot; sounds for all the world to me like a DNS problem.

His question was about sending email, not receiving it. And all my supposedly sideline testing has shown that his machine is not performing MX lookups correctly.

As I see it, some of the reasons for not being able to perform an MX lookup are:
1. Bad network setup. Missing default gateway, etc.
2. Bad DNS setup. DNS seems to be working if he can ping both 18.181.0.31 and But the MX resolution problem from his server is still a nagging one.
3. Bad firewall setup, either internal or external to the box.
Want the best answers? Ask the best questions: TANSTAAFL!
 
I think bluegroper is right. It may be my ISP. I would contact them, but I'm changing ISPs in a week, anyways, from dsl to cable.

I do have a domain name, but it points at a dynamic IP. My IP has been the same for a month, but due to a power outage last night, I have to wait for my DNS entry to propogate before I can test it again. I'm changing to cable, so I can have a static IP.

Yes, I have an MX record for my domain. It's the same as my A record, though. IOW, my domain is mydomain.com, my MX record is also mydomain.com. Does that matter, or do I need to have it at mail.mydomain.com?

Both my smtp and pop ports are open in my router. Ironically, I went to that security site just to see what it said, and it gave me a bunch of big scary warnings about having my mail ports open, which I found amusing.

As far as sendmail.mc goes, I made my own because the default one with my distro broke sendmail. There's definitely no DAEMON_OPTIONS in it.
 
If you are switching to cable to get a static ip, I'd check into it. It's usually the other way around. As for your &quot;MX&quot; record goes, you are correct in that you can use just the domain name. It's just a common practice to use a different sub-domain for each protocol i.e. ftp.mydomain.com, mail.mydomain.com and Yes, a sub-domain. The protocol depends on the client being used to access the domain. A browser uses http:// (port 80). An ftp client uses ftp:// (port 21) and so on. So as long as your servers know what to listen for - everything is cool. :) Those online port scanning sites do go a little overboard don't they. But then again, they are trying to sell you their security software.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top