LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Mail Server configuration for only LAN transfer? (https://www.linuxquestions.org/questions/linux-server-73/mail-server-configuration-for-only-lan-transfer-4175463459/)

TTLTimeToLearn 05-25-2013 11:54 PM

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!

bloodstreetboy 05-26-2013 10:15 AM

Take a look at this.
http://forums.pcper.com/showthread.p...ix-and-dovecot

TTLTimeToLearn 05-29-2013 02:43 PM

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

chrism01 05-31-2013 02:17 AM

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.

TTLTimeToLearn 05-31-2013 01:33 PM

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?

chrism01 06-03-2013 01:07 AM

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.


All times are GMT -5. The time now is 01:32 AM.