LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-09-2004, 06:04 AM   #1
gslater
LQ Newbie
 
Registered: Feb 2004
Location: London
Distribution: Ubuntu
Posts: 20

Rep: Reputation: 0
mail server set up


Hi,

I am at my wits end trying to solve a probelm with the set up of my mail server...here is the situation so far:

I am running RH9 on a PC which is dedicated to being both my web server and (hopefully) my email server. I have purchased my own domain name...lets by way of example call this naughtynuns.com.

To extend the example, the hostname on my machine is linuxpc.naughtynuns.com and my web server works fine so there is no problem going to visit www.naughtynuns.com from the outside world.

I am trying to use sendmail as my email program (as this comes with RH9 and I dont want to try another package...qmail etc). I have done the following:

I edited the sendmail.mc file...

I commented out the line DAEMON_OPTIONS('port=smtp,Addr=127.0.0.1, Name=MTA')dnl...since I belive this will allow me to receive incoming mail from the internet.

Next, I did the m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf thingy to update my config file.

So at that point sendmail should be officially up and running.

Next I went to my domain name provider and added a MX (mail exchanger) record

One of my users on the linux box is set up as gslater, so now according to the theory I should be able to send and receive mail on gslater@naughtynuns.com.

On testing this, I have been able to send mail quite effectively (I receive it as a message from gslater@linuxpc.naughtly nuns.com), but I am unable to receive mail...here is the return message I receive when I try:

550 5.1.2 <gslater@naughtynuns.com>... Host unknown (Name server: linuxpc.naughtynuns.com.: host not found)
Reporting-MTA: dns; loninmrp6.uk.db.com
Received-From-MTA: DNS; localhost
Arrival-Date: Wed, 9 Jun 2004 08:04:37 +0100

Final-Recipient: RFC822; gslater@naughtynuns.com
Action: failed
Status: 5.1.2
Remote-MTA: DNS; linuxpc.naughtynuns.com
Last-Attempt-Date: Wed, 9 Jun 2004 08:04:37 +0100
Return-Path: <gslater@db.com>
Received: from sdbo1003.db.com by loninmrp6.uk.db.com
id i5974a3a001824; Wed, 9 Jun 2004 08:04:37 +0100

anyone know where I have gone wrong?
 
Old 06-09-2004, 06:19 AM   #2
OceanSurf
Member
 
Registered: Aug 2003
Location: Si
Distribution: SuSE, Slackware
Posts: 37

Rep: Reputation: 15
is your 'mail' server written down in DNS???

I had similar problems with SMTP rejecting my emails, because mail was not entered in my DNS configuration!
 
Old 06-09-2004, 07:12 AM   #3
gslater
LQ Newbie
 
Registered: Feb 2004
Location: London
Distribution: Ubuntu
Posts: 20

Original Poster
Rep: Reputation: 0
Not sure what you mean by written down in DNS configuration...can you elaborate?

As I menioned, I have purchased a domain name and therefore on the domain name providers system I have got my 'A record' where my domain name (naughtynuns.com) is pointed to my fixed IP address and then seperately I have added the MX record which lists my fully qualified domain name (FQDN)...in my example linuxpc.naughtynuns.com (which is equivalent to my hostname on my pc
 
Old 06-09-2004, 08:06 AM   #4
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
Yep I can see what's wrong.

You've added a MX record fine.

But the machine name is linuxpc.naughtynuns.com i.e it can accept mails for that sub domain. To allow gslater@naughtynuns.com you need to edit /etc/mail/local-host-names file and add that domain.

local-host-names:
------------------------
naughtynuns.com
linuxpc.naughtynuns.com


MX records for zone naughtynuns.com
---------------------
@ IN A [..IP..]
@ IN MX 10 [......]


linuxpc IN A [...]
IN MX 10 linuxpc

Now you should be able to receive gslater@maughtynuns.com and gslater@linuxpc.naughtynuns.com
 
Old 06-09-2004, 08:27 AM   #5
gslater
LQ Newbie
 
Registered: Feb 2004
Location: London
Distribution: Ubuntu
Posts: 20

Original Poster
Rep: Reputation: 0
Thanks...dont have access to my machine here at work (perhaps the subject of a future post!)...will try this eve when I get home.
 
Old 06-09-2004, 04:49 PM   #6
gslater
LQ Newbie
 
Registered: Feb 2004
Location: London
Distribution: Ubuntu
Posts: 20

Original Poster
Rep: Reputation: 0
Hi,

I have tried adding linuxpc.naughtynuns.com to my /etc/mail/local-host-names file but alas still gets the same error report back when trying to send mail to that address.

Does it matter that I am not running a DNS on my machine but relying on my DNS provider?
 
Old 06-09-2004, 05:28 PM   #7
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
gslater

If i have understood this correctly your /etc/hosts should look like

127.0.0.1 linuxpc.naughtynuns.com linuxpc localhost.localdomain localhost

Ok
linuxpc is your host or PC name
naughtynuns.com is your FQDN

So your MX record should point to www.naughtynuns.com

you only need one entry in /etc/mail/local-host-names
naughtynuns.com
otherwise sendmail will only let you send mail using gslater@linuxpc.naughtynuns.com

If you had another machine on your network called linuxpc2 your mail log would show mail coming from linuxpc2.naughtynuns.com

Where linuxpc2 is the machine the mail originated from and naughtynuns.com is the domain name Sendmail is responsible for

Hope that makes sense

ps
don't forget that changes made to your DNS entries may take up to 48 hours to take effect so don't expect it to work as soon as you make the changes

Pete

Last edited by Pete M; 06-09-2004 at 05:49 PM.
 
Old 06-09-2004, 05:46 PM   #8
gslater
LQ Newbie
 
Registered: Feb 2004
Location: London
Distribution: Ubuntu
Posts: 20

Original Poster
Rep: Reputation: 0
Pete,

my etc hosts file looks like this:

127.0.0.1 localhost.localdomain localhost
192.168.0.4 linuxpc.naughtynuns.com linuxpc mail www

that is what I saw on some of the other postings on this forum...as 192.168.0.4 is the ip address on my local lan for this machine.

I can change my MX record to www.naughtynuns.com ...so does this mean the FQDN must be prefixed by www? I was under the impression:
a) that it needed to include the host name ie the linuxpc part, and
b) that it didn't need the www

guess I was wrong.

Will change my MX record accordingly.

Does it matter that my etc/hosts file is in the above format?
 
Old 06-09-2004, 05:59 PM   #9
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
gslater

Quote:
my etc hosts file looks like this:
127.0.0.1 localhost.localdomain localhost
192.168.0.4 linuxpc.naughtynuns.com linuxpc mail www
Does'nt really matter but your IP is'nt needed because sendmail listens on all available interfaces and mail, www are'nt needed either
Quote:
I can change my MX record to www.naughtynuns.com ...so does this mean the FQDN must be prefixed by www? I was under the impression:
a) that it needed to include the host name ie the linuxpc part, and
b) that it didn't need the www
My mistake just use naughtynuns.com I used the www part only as an example

As I said earlier linuxpc is only your machine or host name not your FQDN

Please look at my edit if you have'nt already done so changes may take 48 hours to take effect

Pete

Last edited by Pete M; 06-09-2004 at 06:02 PM.
 
Old 06-09-2004, 07:25 PM   #10
Pete M
Member
 
Registered: Aug 2003
Location: UK
Distribution: Redhat 9 FC 3 SUSE 9.2 SUSE 9.3 Gentoo 2005.0 Debian Sid
Posts: 657

Rep: Reputation: 32
gslater

As a side note what did you enter for your A record because your MX record should match

MX records must have a corresponding A record

Just an after thought

Pete
 
Old 06-10-2004, 01:44 AM   #11
shmude
Member
 
Registered: Aug 2003
Distribution: Fedora, DSL, LAS, Knoppix
Posts: 83

Rep: Reputation: 15
Just a friendly reminder... but did you open ports through your firewall?

also, you can check to see if your MX records are pointed in the right directions by using nslookup and setting the querytype to MX and then typing in your domain name. It should show what MX records are for the domain, and where it points to. If it is pointing to mail.naughtynuns.com then you need to make sure that their is an A host for mail.naughtynuns.com and it points to your IP address.
 
Old 06-10-2004, 05:56 AM   #12
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
Quote:
Originally posted by gslater
Hi,

I have tried adding linuxpc.naughtynuns.com to my /etc/mail/local-host-names file but alas still gets the same error report back when trying to send mail to that address.

Does it matter that I am not running a DNS on my machine but relying on my DNS provider?
Post the actual domain name and we can track your problem better.

Simple suggestions:

1) Make sure your domain linuxpc.naughtynuns.com and naughtynuns.com have an A address and appropriate MX record
2) Verify using nslookup externally.
nslookup
> set type=mx
>naughtynuns.com

3) Telnet to host (whereever mx points) and port from somewhere external.
telnet [MXHOST] 25
See if you get a response from your server
If not then you need to open your firewall

4) If everything is fine then run sendmail in test mode and test
sendmail -bt
5) Check local-host-names if the machine wants to receive mails for domain naughtynuns.com
6) Make sure the mailserver can resolve dns names like yahoo.com etc etc


Since you are getting host unknown it would appear that naughtynuns.com does not have an A record or your machine cannot resolve domain names. Check /etc/resolv.conf
 
Old 06-10-2004, 10:55 AM   #13
gslater
LQ Newbie
 
Registered: Feb 2004
Location: London
Distribution: Ubuntu
Posts: 20

Original Poster
Rep: Reputation: 0
Hi,

ok...example over here is the domain name....gavinslater.com

I have now changed my MX records so now I have an A record and MX record for gavinslater.com....actually they way it appears on my site the A reecord simply points to my ip address and the C Name says gavinslater.com...but I guess this is correct.

Next, I sent another test mail...this time I get an error saying relaying denied...here it is:

The original message was received at Thu, 10 Jun 2004 16:37:24 +0100
from localhost [127.0.0.1]

----- The following addresses had permanent fatal errors -----
<gslater@gavinslater.com>
(reason: 550 5.7.1 <gslater@gavinslater.com>... Relaying denied)

----- Transcript of session follows -----
... while talking to gavinslater.com.:
>>> DATA
<<< 550 5.7.1 <gslater@gavinslater.com>... Relaying denied
550 5.1.1 <gslater@gavinslater.com>... User unknown
<<< 503 5.0.0 Need RCPT (recipient)
Reporting-MTA: dns; loninmrp0.uk.db.com
Received-From-MTA: DNS; localhost
Arrival-Date: Thu, 10 Jun 2004 16:37:24 +0100

Final-Recipient: RFC822; gslater@gavinslater.com
Action: failed
Status: 5.7.1
Remote-MTA: DNS; gavinslater.com
Diagnostic-Code: SMTP; 550 5.7.1 <gslater@gavinslater.com>... Relaying denied
Last-Attempt-Date: Thu, 10 Jun 2004 16:37:52 +0100
Return-Path: <gavin.n.slater@db.com>
Received: from sdbo1003.db.com by loninmrp0.uk.db.com
id i5AFbO97012510; Thu, 10 Jun 2004 16:37:24 +0100
Subject: test
To: gslater@gavinslater.com
X-Mailer: Lotus Notes Release 5.0.11 July 24, 2002
Message-ID: <OF28667189.1AEB420E-ON80256EAF.0055C4C9-80256EAF.0055D093@db.com>
From: "Gavin N Slater" <gavin.n.slater@db.com>
Date: Thu, 10 Jun 2004 16:37:19 +0100
X-MIMETrack: Serialize by Router on sdbo1003/DMGUK/DeuBaInt/DeuBa(5012HF499 | November
14, 2003) at 10/06/2004 04:37:24 PM
MIME-Version: 1.0
Content-type: text/plain; charset=us-ascii


Is it being denied due to a firewall issues on my side?
 
Old 06-10-2004, 01:24 PM   #14
shmude
Member
 
Registered: Aug 2003
Distribution: Fedora, DSL, LAS, Knoppix
Posts: 83

Rep: Reputation: 15
Everything in DNS seems to look OK. And i can telnet to port 25 and get a response from your server so i know that it is getting through your firewall and that the problem is now inside your sendmail configuration. Since i know nothing about sendmail, im going to have to pass this to somebody else. Good luck on the problem! Oh and i sent you a test email to see if it works properly from my end.

**EDIT**
This is the reply back when i tried to send you an email.

Reporting-MTA: dns; fed1rmmtao09.cox.net
Arrival-Date: Thu, 10 Jun 2004 14:21:57 -0400
Received-From-MTA: dns; dobbi (68.2.x.x)

Final-Recipient: RFC822; <gslater@gavinslater.com>
Action: failed
Status: 5.1.1
Remote-MTA: dns; gavinslater.com (212.158.206.133)
Diagnostic-Code: smtp; 550 5.7.1 <gslater@gavinslater.com>... Relaying denied

I'm wondering if you are on some type of black list where servers arn't allowed to relay to you. Are you allowed to have a mail server with your ISP? You might want to check that.

Last edited by shmude; 06-10-2004 at 01:34 PM.
 
Old 06-10-2004, 01:49 PM   #15
gslater
LQ Newbie
 
Registered: Feb 2004
Location: London
Distribution: Ubuntu
Posts: 20

Original Poster
Rep: Reputation: 0
Hi,

I dont think I am on a blacklist as I have not had the mail server up and running very long...also I keep a terminal window running with my mail log messages running so I know there has not been much activity across my server (other than myself of course).

My mail log messages for the denied test emails show the following:

Jun 10 16:37:52 linuxpc sendmail[2579]: i5AFbRLb002579: ruleset=check_rcpt, arg1=<gslater@gavinslater.com>, relay=loninmrp0.uk.db.com [160.83.52.97], reject=550 5.7.1 <gslater@gavinslater.com>... Relaying denied
Jun 10 16:37:52 linuxpc sendmail[2579]: i5AFbRLb002579: from=<gavin.n.slater@db.com>, size=928, class=0, nrcpts=0, bodytype=7BIT, proto=ESMTP, daemon=MTA, relay=loninmrp0.uk.db.com [160.83.52.97]
Jun 10 19:22:13 linuxpc sendmail[2593]: i5AILvLb002593: ruleset=check_rcpt, arg1=<gslater@gavinslater.com>, relay=fed1rmmtao09.cox.net [68.230.241.30], reject=550 5.7.1 <gslater@gavinslater.com>... Relaying denied
Jun 10 19:22:14 linuxpc sendmail[2593]: i5AILvLb002593: from=<tyler@gettycomputers.com>, size=2331, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=fed1rmmtao09.cox.net [68.230.241.30]

Does this help at all?
 
  


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
What do i need to set up a mail server tomed Linux - Networking 3 11-05-2004 11:06 AM
what do i need to do to set up mail server feetyouwell Linux - Software 6 02-16-2004 01:08 PM
How do I set up a Mail Server jamie_barrow Linux - Newbie 8 07-21-2003 11:56 AM
Set up Mail server kelper Linux - General 1 05-12-2003 12:17 AM
How do I set up a mail server? ChaosX2 Linux - Networking 10 05-30-2002 03:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:12 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