LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 08-05-2014, 05:06 AM   #1
mr_si
Member
 
Registered: Nov 2006
Distribution: Server: Centos 6.6, Desktop: OpenSUSE 12.3
Posts: 34

Rep: Reputation: 4
Email Server setup - Centos 6.3


Dear all,

First of all, please forgive me as I come from a Microsoft server support background so my understanding is based on the general practise over at the dark side. However, I have used linux in a desktop environment at home for some time.

I have a Centos 6.3 server running in my home network serving files at the moment. It is also doing its own DNS.

It's just a Dell R200 with a couple of 1TB SATA disks in RAID 1 and 4GB of RAM. Nothing that special. Centos installation is the minimal one as I didn't want a GUI to hog all the CPU and memory.

However I would like to utilise it for my email serving too.

Currently its hostname is "file1.domain.lan" but I will probably change it to "server.domain.lan".

Now having a static IP with my ISP and using a Sonicwall as the HW Firewall and for NAT Policies, I wish to have the server receive email for, initially, *@differentdomain.co.uk

Now, all the tutorials I have seen so far, are based on setting the server up within an external domain but I am used to having an internal domain and an external domain (having used MS servers for a long time with Exchange Server handling emails).

I have so far unsuccessfully set up Postfix as all my test emails from external to internal have bounced with either the details that "DNS has no data" or that it is an "unroutable address".

But I can externally telnet on port 25 to the server. It just won't send email to the end user.

Sendmail has been removed from the server.


So, hostname is currently: file1.domain.lan
Email domain to receive: @differentdomain.co.uk

My main.cf file for postfix has the following uncommented lines (I have been playing around with the hostname and domain lines in case they needed to be the external ones as below):

Code:
mail_owner = postfix
myhostname = mail.differentdomain.co.uk
mydomain = differentdomain.co.uk
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost
unknown_local_recipient_reject_code = 550
mynetworks_style = host
mynetworks = 192.168.199.0/24, 127.0.0.0/8, 192.168.0.2
relay_domains =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
home_mailbox = Maildir/
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

resolv.conf is as follows
Code:
# Generated by NetworkManager
nameserver 192.168.199.1 # server IP
nameserver 192.168.0.1
nameserver 8.8.8.8

Is there anything I would need to add to my main.cf file or change in it?

I tried the following at the beginning but to no avail either.

myhostname = file1.domain.lan
mydomain = domain.lan
 
Old 08-05-2014, 08:27 AM   #2
devil24g
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Rep: Reputation: Disabled
add $mydomain to mydestination

And also you need add a mx record in your dns zone that point to your public ip, and nat the port 25 to your postfix.
 
Old 08-05-2014, 10:34 AM   #3
mr_si
Member
 
Registered: Nov 2006
Distribution: Server: Centos 6.6, Desktop: OpenSUSE 12.3
Posts: 34

Original Poster
Rep: Reputation: 4
Hi there,

Thank you for your reply. In terms of the MX record, does that have to be local on my server's zone files? Also, does it have to be in both the rev.domain.lan and fwd.domain.lan files?

Thanks,
Simon
 
Old 08-05-2014, 04:06 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
one of the VERY FIRST things is upgrade
in the 6 series ONLY!!! CentOS 6.5 is supported

6.3 has NOT received any SECURITY updates since February of 2013!!!


now depending on HOW yum is set up
a normal update would have moved it to 6.4 then 6 months later 6.5

or

you would have to EXPLICITLY upgraded

Code:
su -
yum --releasever=6.5 upgrade
To check what version you are using run
Code:
cat /etc/redhat-release
 
Old 08-05-2014, 05:40 PM   #5
devil24g
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Rep: Reputation: Disabled
Quote:
Originally Posted by mr_si View Post
Hi there,

Thank you for your reply. In terms of the MX record, does that have to be local on my server's zone files? Also, does it have to be in both the rev.domain.lan and fwd.domain.lan files?

Thanks,
Simon
If you want to receive emails from wan, then you should add your dns records to your registered domain name dns.
 
Old 08-06-2014, 07:43 AM   #6
mr_si
Member
 
Registered: Nov 2006
Distribution: Server: Centos 6.6, Desktop: OpenSUSE 12.3
Posts: 34

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by John VV View Post
one of the VERY FIRST things is upgrade
in the 6 series ONLY!!! CentOS 6.5 is supported

6.3 has NOT received any SECURITY updates since February of 2013!!!


now depending on HOW yum is set up
a normal update would have moved it to 6.4 then 6 months later 6.5

or

you would have to EXPLICITLY upgraded

Code:
su -
yum --releasever=6.5 upgrade
To check what version you are using run
Code:
cat /etc/redhat-release

You are right, I am on 6.5, sorry for the confusion.
 
Old 08-06-2014, 07:48 AM   #7
mr_si
Member
 
Registered: Nov 2006
Distribution: Server: Centos 6.6, Desktop: OpenSUSE 12.3
Posts: 34

Original Poster
Rep: Reputation: 4
Quote:
Originally Posted by devil24g View Post
If you want to receive emails from wan, then you should add your dns records to your registered domain name dns.
I thought I mentioned that I was able to telnet to the server externally on port 25. If not, I apologise. But I can telnet to the server by its FQDN using the external DNS name.

I can do the ehlo test but the mail just doesn't go anywhere.

I have also found that I cannot do internal email.

So, I changed it so that the server's domain was the same as the external domain, so both are using mydomain.co.uk now, with the server's hostname being server.mydomain.co.uk

zone files have been changed to reflect this and so has the main.cf file.

I'm at a loss as to what's gone wrong.
 
Old 08-07-2014, 07:52 AM   #8
devil24g
LQ Newbie
 
Registered: Nov 2012
Posts: 11

Rep: Reputation: Disabled
Quote:
Originally Posted by mr_si View Post
I thought I mentioned that I was able to telnet to the server externally on port 25. If not, I apologise. But I can telnet to the server by its FQDN using the external DNS name.

I can do the ehlo test but the mail just doesn't go anywhere.

I have also found that I cannot do internal email.

So, I changed it so that the server's domain was the same as the external domain, so both are using mydomain.co.uk now, with the server's hostname being server.mydomain.co.uk

zone files have been changed to reflect this and so has the main.cf file.

I'm at a loss as to what's gone wrong.
telnet != you have mx record

you can telnet means your domain name is correctly resolved to you ip address. when you send email from a mta it will lookup the mx record on the dns server, if the mx record is found then the mta will send the mail to the ip address which your mx record points to. you should check your domain name provider's dns setting first.

and also can you receive internal mail?

Last edited by devil24g; 08-07-2014 at 07:54 AM.
 
Old 08-08-2014, 04:50 AM   #9
mr_si
Member
 
Registered: Nov 2006
Distribution: Server: Centos 6.6, Desktop: OpenSUSE 12.3
Posts: 34

Original Poster
Rep: Reputation: 4
Hi there, no I realise that.

I do however, have an MX record and DNSStuff.com confirms that it is there and pointing correctly.
The server just doesn't respond to SMTP stuff, but yet it is accepting connections on port 25, showing that my Firewall is correctly set up (and telnetting on port 25 shows that I am correctly allowing traffic through too).

as said in my previous post, the one that you quoted, no internal mail doesn't want to work either.
 
  


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
Unable to setup a NIS server setup on CentOS system swatidas11 Linux - Server 3 01-19-2010 07:01 PM
LXer: CentOS 4.6 Server Setup: LAMP, Email, DNS, FTP, ISPConfig LXer Syndicated Linux News 0 01-10-2008 03:40 PM
LXer: CentOS 5.1 Server Setup: LAMP, Email, DNS, FTP, ISPConfig LXer Syndicated Linux News 0 12-06-2007 03:21 PM
Email Server Setup LinksDragon Linux - Server 2 03-06-2007 10:07 AM
Email Server Setup gmalleus Linux - General 1 08-11-2005 02:33 PM

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

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