LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-25-2013, 11:54 PM   #1
TTLTimeToLearn
LQ Newbie
 
Registered: May 2013
Posts: 3

Rep: Reputation: Disabled
Mail Server configuration for only LAN transfer?


Hey everyone,

I'm attempting to create a Mail server and have been doing a little bit of research for the past week.

I haven't had much luck with it. I only need the mail server to be able to send mail over a LAN from the server to other host computers on the network.

I've been attempting to learn PostFix but everything I read about it, everyone seems to be mentioning registering to a DNS service. Can I skip having to setup a DNS service and use the host file on the server, and then point the MUA on the host computers point to the IP address of the server? (Using Evolution as the MUA)

thanks in advance!
 
Old 05-26-2013, 10:15 AM   #2
bloodstreetboy
Member
 
Registered: May 2012
Posts: 201
Blog Entries: 3

Rep: Reputation: 37
Take a look at this.
http://forums.pcper.com/showthread.p...ix-and-dovecot
 
Old 05-29-2013, 02:43 PM   #3
TTLTimeToLearn
LQ Newbie
 
Registered: May 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for the reply, but herein lies my problem. I might just be completely Linux inept in this department, but how do I issue a domain name to my Linux box? is this just understood when I set my hostname to something along the lines of (My 'site' name will be Australia) server.australia.com, the domain becomes australia.com? or is this the part that the configuration file sets up by doing this part:

myhostname = hostname.example.com
mydomain = example.com
myorigin = $mydomain

inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.0.0/24, 127.0.0.0/8
relay_domains =
home_mailbox = Maildir/

I want this box to be independent of a Windows domain service if possible.

I've been able to use Dovecot's IMAP and use Mutt to mail local users so far :P
 
Old 05-31-2013, 02:17 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
IFF (if and only if) this is strictly for internal use only (as you imply), then you can call the server anything you want.

The convention these days is host.net.local or even host.subdomain.net.local and add all the clients in /etc/hosts (if there's a reasonable number) eg
Code:
cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

# This box : IP must match settings in eth cfg
# eg RHEL/Centos /etc/sysconfig/network-scripts/ifcfg-eth0
192.168.1.100	myserver.hw.net.local myserver

# clients
192.168.1.101	client1.hw.net.local client1
192.168.1.102	client2.hw.net.local client2
You get the idea...

This requires clients to have a static address.
Alternately, they can have static addresses assigned by a DHCP server, based on MAC address.

The main thing, even if they are dynamic, is that they must be in the same subnet address range.
 
Old 05-31-2013, 01:33 PM   #5
TTLTimeToLearn
LQ Newbie
 
Registered: May 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Oh Myyyyy....

That looks extremely useful!

This is for a college class project and we've never covered mail servers in Linux ( I can do Windows just fine! :P ), so i've been trying to learn it from scratch and everything I read even about internal servers skips over the host file configuration.

Does the actual hostname impact anything and does the host file need to be configured accordingly on each client?

So this is what I'm going to try


/ETC/HOSTS --Configuration
#This is THIS 'server's' IP address
10.0.2.15 server.australia.com.local server

#Clients
10.0.2.18 client1.australia.com.local client1 (have a host machine with the user client1)
10.0.2.19 client2.australia.com.local client2 (have a host machine with the user client2)

--------------------------------------------------

In PostFix

myhostname = server.australia.com.local
mydomain = australia.com.local
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 10.0.2.0/24, 127.0.0.0/8
home_mailbox = Maildir/

In Dovecot
protocols = pop3
mail_location = maildir:~/Maildir (appended to bottom of config file)

-----------------------

Does that all seem sound?
 
Old 06-03-2013, 01:07 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
I'm no postfix expert, but it looks like you're heading in the right direction.
Don't leave out the localhost entry in /etc/hosts though (you probably only need the IPV4 version).
If you've got a test network, give it a go.

Note that here you're only bypassing DNS by using hosts file instead. Each machine will need an equiv set of entries... (that's why DNS was invented, way back when; the then ARPAnet got too big to use this technique).
To definitely stop people sending emails outside, you'd have to block them at pt of LAN exit, just to be sure.
 
  


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
How to transfer mail server(all mail account, message of all user) to another machine addil Linux - Newbie 4 04-13-2009 08:02 AM
postfix mail server cant receive mail outside LAN shio Linux - Networking 2 10-05-2007 05:01 AM
LAN Mail server stefdaniels Linux - General 1 03-04-2005 12:57 PM
Why cant I transfer mail from server to client? artz Linux - Networking 10 08-09-2004 05:39 AM
mail server / junk mail configuration CtrlAltDel Linux - Software 2 01-16-2004 04:35 PM

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

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