LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-22-2008, 05:39 PM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Rep: Reputation: 69
Need some help configuring my mail server


I have sendmail running. I have changed the sendmail.mc so that it can send/receive email from to and from outside the internal network.

I then modified the the hosts.allow file by putting
sendmail: ALL

I then regenerated the sendmail.cf with
make sendmail.cf -C /etc/mail

and restarted senmail.

I bought a domain name from an online company 1 and 1. I have a web page with this domain name. I want to setup my mail server with this domain name as well. I went to the control panel for this account on the 1 and 1 site. I'm doing all the hosting, but I needed to change the mx server from 1 and 1 to mine. I don't understand but an MX server is a domain name and not an ip address.

Where do I name or where do I find out what name of my MX server is?

I have ports open for pop3 and smtp.

Also, how do I send/receive email from the terminal?

Last edited by trist007; 05-22-2008 at 08:13 PM.
 
Old 05-23-2008, 10:08 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,519

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
If I understand well, you want to setup the mx record for your domain. If that's the case, then you must put the name of your mailserver in the mx record.
Now to test your mailserver from CLI you can use telnet:

test smtp:
Code:
telnet localhost 25
helo domain.com
mail from: user@yahoo.com
rcpt to: you@domain.com
data
subject: test
blah
blah blah
.
test pop3
Code:
telnet localhost 110
USER you
PASS passwrod
LIST
RETR #   <-- # is the numbe of the message you want to read
QUIT
 
Old 05-23-2008, 04:13 PM   #3
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,027

Original Poster
Rep: Reputation: 69
So on the MX record I get to name my mail server whatever? Where do I find the name ot
So if I get to name it, i'd put something like

mail.mydomain.com ?

I'm confused. I bought a domain name at 1and1.com

Originally, they were doing all the hosting. Then, I started using linux and found out that I could do my own hosting. So, I copied and pasted my website and put it on a computer here in my network at my apt. That network has port 80 open, as well as the router forwarding any http requests to port 80 on that machine. So my website works from outside the network. This website is for personal use, and has no valuable data. I do not have a static ip address, but that computer is always on and remains with the same ip address.

I was told that I needed to purchase a static ip through my local isp. My local isp offers static ip addresses but are very expensive, because they're meant for a business. I decided against it. I have also found out that the external ip address of my router remains static, unless I turn my router off for more than 10 secs. So that make its confusing. Why do businesses pay more for a static ip address when you could simply keep an ip address as long as ur router doesn't get reset or stay off more than 10 secs. Even if ur router did change, u simply change the new ip address of the external router in the control panel of domain name vendor.

Anyhow, so my website works. I know want to setup a mail server under that domain so I could have email addresses like user@mydomain.com. I can currently get mail through an email account user@mydomain.com but I have to go through 1and1.com to get my mail. I'd rather set this up on my own computer.
So I setup sendmail and made various modificiations to the macro file, as posted in my first post. I then went to the control panel of my domain name vendor, where I could change the mail server. To change a mail server, I needed to put an name in the MX Record. I figured mail.mydomain.com would suffice. But it's giving me errors. What do I do at this point? Also, I'm getting the feeling that I need to create a subdomain like
ns.mydomain.com for dns purposes. Do I need to do that? and what for? Do I need to add nameservers or DNS servers? Can someone explain to me what and how the MX record works?
 
Old 05-24-2008, 11:25 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,519

Rep: Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501Reputation: 1501
It is not going to work if your router can only forward port 80. It should be able to also forward ports 25,110 (and 143 if you'll use imap).
Quote:
I'm confused. I bought a domain name at 1and1.com
Originally, they were doing all the hosting.
I guess that 1and1 is doing the dns for you domain. So assuming that you can do the forwarding, then you can either setup the mail service on 1and1 to forward emails to your home computer, or you can gi with the mx record. You have to add an entry in dns for mail.mydomain.com (put your almost static ip) and then use mx with mail.domain.com. Or you can just use as mx the actual name of your box (i.e. www.mydomain.com). You can use any name for the mx record of your domain, as far as this hostname resolvs to an ip address.

Regards
 
  


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
Configuring the mail server. vignesb_gda Linux - Server 1 03-03-2007 01:31 PM
Configuring my mail server juancha Linux - Newbie 1 02-28-2006 08:06 AM
configuring a mail server behind a firewall aaelano Linux - Software 1 09-23-2003 11:19 AM
configuring mail server on linux netpraveen Linux - Networking 1 02-21-2002 11:39 PM


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