LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 06-22-2009, 12:22 PM   #1
MikeQ
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Rep: Reputation: 0
Setting up a mail server


Is this the correct way about setting up a mail server?
http://i42.tinypic.com/2d92rl1.jpg

And if so, how do I go about doing it? Mail has never been one of my strong points.
 
Old 06-22-2009, 01:49 PM   #2
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
I can't tell from the image what it is you are trying to accomplish.. care to explain a bit more about your environment and goals ?

Setting up a mail server for what ?
 
Old 06-22-2009, 02:12 PM   #3
MikeQ
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Original Poster
Rep: Reputation: 0
I'm trying to relay the mail from the server hosting the websites to a dedicated mail server.
 
Old 06-22-2009, 04:01 PM   #4
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
And the sever hosting the website is running which EXIM or Sendmail ? I was confused because both are listed next to the web server.

And what distribution of Linux is the Web server running ? might be a simple way to make the configuration change. Debian / Ubuntu for installce allows you to run dpkg-reconfigure <packagename> to configure smarthost settings for exim or postfix.

EXIM 4 : SMTP Relay using a smarthost
http://www.lexspoon.org/linux/smtp-relay.html

Sendmail : SMTP relay using a smarthost
http://cri.ch/linux/docs/sk0009.html

Quote:
Originally Posted by wikipedia
a smarthost is a type of mail relay server which allows an SMTP server to route e-mail to an intermediate mail server rather than directly to the recipient’s server.
 
Old 06-22-2009, 07:39 PM   #5
MikeQ
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Original Poster
Rep: Reputation: 0
don't you need sendmail for the php mail() function? reason i have it listed. sendmail sends the mail to exim and then exim sends it to exim on the mail server to be sent out?
 
Old 06-22-2009, 07:47 PM   #6
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
I think you should change the MX handlers in DNS to point to the mail server you want to use. That's how you would seperate the hosting from mail. Or wait did you say relay mail. You are trying to seperate the services right?
 
Old 06-22-2009, 09:52 PM   #7
MikeQ
LQ Newbie
 
Registered: Jun 2009
Posts: 18

Original Poster
Rep: Reputation: 0
yeah, i would like to have 1 server run all the mail incoming and outgoing.
 
Old 06-22-2009, 10:04 PM   #8
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
I see the word "relay" had some of us confused. A relay would be the server1 accepting the mail for the domain(s) and redirecting or relaying it to server2.

What you should do to seperate it is set the CNAME for mail.domain and MX records to point to the mail server you would like to use. This is done by configuration of named (DNS). Does this make sense?
 
Old 06-22-2009, 10:32 PM   #9
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
Here is some basic info on DNS http://rscott.org/dns/ I'm sure there is better links out there but this is some basics.
 
Old 06-22-2009, 11:19 PM   #10
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
you don't need sendmail and exim on the same box to do that. either sendmail alone or postfix alone will be able to send mail from the web server.

the relayhost settings will allow the smtp server on your webserver to forward the mail to your primary mail server for Internet delivery.
 
Old 06-22-2009, 11:27 PM   #11
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
farslayer: wouldn't this just cause more traffic to the webserver when you want the mail server to handle all the requests? I mean if server1 is handling web and server2 is handling mail why relay from on to the other when you can skip the relay part with DNS. I guess there is still DNS traffic (I don't see a way around it) but both DNS & smtp relay traffic seems like it would be heavier or redundant.
 
Old 06-23-2009, 08:09 AM   #12
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
The purpose of a SMTP server on the Webserver box is to handle email being sent outbound from the website. Like when a user registers for the website, wiki, or Forum the web server would email a confirmation to the user. it is not to handle internet mail for the domain. Most web packages (Joomla, Drupal, wikis, CMS Sites, forums, etc..) use the local sendmail binary to send email. Postfix and Exim simulate that binary so they can also send email in this fashion.


Several reasons you would use a smarthost to actually deliver the email.

1. You are hosting at home and your provider won't allow your systems to send email directly except via their servers. so your web server can use your ISP's SMTP server to actually deliver email to your websites visitors..

2. Corporate environment, wants ALL internet mail to enter and exit the network via ONE mail server. So having the web server hand off it's email to the primary mail server means less ports to open to less machines through the firewall.. Simplifies the firewall configuration and leaves fewer internet facing ports open.

3. Mail from your site will be coming from the Smarthost (Primary SMTP Server) which is a valid SMTP server for your domain it has all the proper MX records and rDNS configured already.. theres no need to add additional records for the webserver, because you are using infrastructure and configurations that are already in place.


Not really an additional DNS load on the webserver, since the SMTP config file tells it exactly where the SMTP server is that it is forwarding the mail to. for delivery. and you are not trying to steer incoming mail. all incoming email will be going to the primary SMTP server as it should, it would not be destined for the web server.

Hope that helps to explain some of the reasons for this configuration, and the use of a smarthost.
 
Old 06-23-2009, 12:32 PM   #13
micxz
Senior Member
 
Registered: Sep 2002
Location: CA
Distribution: openSuSE, Cent OS, Slackware
Posts: 1,131

Rep: Reputation: 75
It does explain the reasons and your are right my solution does not handle the local mail (realized this right as my head hit the pillow) and issues revolving around home hosting or many other specific setups. I was not thinking ahead' I hope MikeQ is following all this.
 
  


Reply



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
setting up a mail server: unable to recieve mail Valkyrie_of_valhalla Linux - Networking 3 09-15-2006 01:29 PM
Setting up a Mail Server dr_angus Linux - Software 1 03-09-2005 09:57 AM
[SOLVED] Setting up a mail server? ziphem Linux - Newbie 2 11-27-2004 02:09 AM
Setting up mail server gslater Linux - Newbie 2 05-16-2004 09:42 AM
Setting up a mail server linuxguruwannabe Linux - Networking 13 08-07-2000 02:59 PM

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

All times are GMT -5. The time now is 11:28 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
Open Source Consulting | Domain Registration