LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-29-2013, 08:37 PM   #1
sasaditya
Member
 
Registered: Dec 2012
Posts: 34

Rep: Reputation: Disabled
Question mail server in centos 6.3


Configuring mail server with postfix,dovecot and squirrelmail in centos 6.3


Assining the temparory hostname
[root@server ~]#hostname mail.server.com
Assining the permanent hostname
[root@server ~]#vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=yes
HOSTNAME=mail.server.com
NETWORKING_IPV4=yes
Gateway=192.168.0.30
Assining the temparory ip configuration
[root@server ~]#ifconfig eht0 192.168.0.30 netwrok 255.255.255.0 broadcast 192.168.0.255
Assining the permanent ip configuration
[root@server ~]#vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
USERCTL=no
ONBOOT=yes
BOOTPROTO=none
BROADCAST=192.168.0.255
NETWORK=192.168.0.0
NETMASK=255.255.255.0
IPADDR=192.168.0.30
IPV4INIT=yes
IPV6INIT=no
Allow host to network
[root@server ~]#cat /etc/hosts
127.0.0.1 loacalhost localhost.localdoamin localhost4 localhost4.localdomain4
192.168.0.30 mail mail.server.com
Restarting the network services
[root@server ~]#service network restart

Installation
Postfix is installed by default. If it is not installed, use the below command to install postfix.
[root@mail ~]#yum install postfix –y

Configuration
Open the postfix config file /etc/postfix/main.cf. Find the below lines and edit them as shown below
[root@mail ~]#vi /etc/postfix/main.cf
75:myhostname = mail.server.com
83:mydomain = server.com
99:myorigin = $mydomain
116:inet_interfaces = all
164:mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
264:mynetworks = 192.168.1.0/24, 127.0.0.0/8
419:home_mailbox = Maildir/
Start the postfix service.
[root@server ~]# service postfix start
Starting postfix: [ OK ]
[root@server ~]# chkconfig postfix on

Test Postfix
The commands shown in bold letters should be entered by the user.
Note: The dot after the test command is important.
[root@server ~]# telnet localhost smtp
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 server.ostechnix.com ESMTP Postfix
ehlo localhost
250-server.ostechnix.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
mail from:<tom>
250 2.1.0 Ok
rcpt to:<tom>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
test
This is the recive data from tom
.
250 2.0.0 Ok: queued as 117113FF18
quit
221 2.0.0 Bye
Connection closed by foreign host.
Check Mail
Navigate to the user mail directory and check for the new mail.
[root@server ~]# cd /home/tom/Maildir/new/
[root@server new]# ls
1360236956.Vfd00I35afM181256.mail.server.com
[root@server new]# cat 1360236956.Vfd00I35afM181256.mail.server.com
Return-Path: <tom@server.com>
X-Original-To: tom
Delivered-To: mail@server.com
Received: from localhost (localhost [IPv6:::1])
by mail.server.com (Postfix) with ESMTP id 117113FF18
for <user1>; Thu, 7 Feb 2013 17:05:32 +0530 (IST)
Message-Id: <20130207113547.117113FF18@mail.server.com>
Date: Thu, 7 Feb 2013 17:05:32 +0530 (IST)
From: tom@server.com
To: undisclosed-recipients:;
test
This is the revice data from tom
Thats it. Postfix working now.

Install Dovecot
[root@server ~]# yum install dovecot –y

Configure Dovecot
Open the dovecot config file /etc/dovecot/dovecot.conf. Find and uncomment the line as shown below.
[root@server ~]# vi /etc/dovecot/dovecot.conf
20rotocols = imap pop3 lmtp
Open the file /etc/dovecot/conf.d/10-mail.conf and uncomment the line as shown below.
[root@server ~]# vi /etc/dovecot/conf.d/10-mail.conf
24:mail_location = maildir:~/Maildir
Open the /etc/dovecot/conf.d/10-auth.conf and edit as shown below.
[root@server ~]# vi /etc/dovecot/conf.d/10-auth.conf
9:disable_plaintext_auth = no
97:auth_mechanisms = plain login
Open the /etc/dovecot/conf.d/10-master.conf and edit as shown below.
[root@server ~]# vi /etc/dovecot/conf.d/10-master.conf
unix_listener auth-userdb {
#mode = 0600
83:user = postfix
84:group = postfix
Start the dovecot service.
[root@server ~]# service dovecot start
Starting Dovecot Imap: [ OK ]
[root@server ~]# chkconfig dovecot on
Test Dovecot
The commands shown in bold should be entered by the user.
[root@server ~]# telnet localhost pop3
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user tom
+OK
pass tom
+OK Logged in.
list
+OK 1 messages:
1 428
.
retr 1
+OK 428 octets
Return-Path: <tom@server.com>
X-Original-To: tom
Delivered-To: tom@server.com
Received: from localhost (localhost [IPv6:::1])
by mail.servcer.com (Postfix) with ESMTP id 117113FF18
for <tom>; Thu, 7 Feb 2013 17:05:32 +0530 (IST)
Message-Id: <20130207113547.117113FF18@mail.server.com>
Date: Thu, 7 Feb 2013 17:05:32 +0530 (IST)
From: tom@server.com
To: undisclosed-recipients:;
test
This is the recive data from tom
.
quit
+OK Logging out.
Connection closed by foreign host.


Dovecot is working now.

Install Squirrelmail
Install EPEL repository first. And install SquirrelMail package from EPEL repository.
[root@server ~]#rpm –ivh epel-release-6-8.noarch.rpm
[root@server ~]#yum install squireelmail –y
[root@server ~]#service httpd start
: [OK]
[root@server ~]#chkconfig httpd on

Configure Squirrelmail
Go to the squirrelmail config directory and use the command ./conf.pl to start configure as shown below.
[root@server ~]# cd /usr/share/squirrelmail/config/
[root@server config]# ./conf.pl
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color off
S Save data
Q Quit
Command >>1

Select option 1 and set organization details.

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Organization Preferences
1. Organization Name : server
2. Organization Logo : ../images/sm_logo.png
3. Org. Logo Width/Height : (308/111)
4. Organization Title : Welcome to my test server
5. Signout Page :
6. Top Frame : _top
7. Provider link : http://server.com
8. Provider name : my test server
R Return to Main Menu
C Turn color off
S Save data
Q Quit
Command >>R

Press R to return main menu and select option 2. Enter your domain name and select dovecot in the Sendmail or SMTP parameter.

SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Server Settings

General
-------
1. Domain : server.com
2. Invert Time : false
3. Sendmail or SMTP : SMTP

A. Update IMAP Settings : localhost:143 (uw)
B. Update SMTP Settings : localhost:25

R Return to Main Menu
C Turn color off
S Save data
Q Quit

Once you done, press S to save datas and press Q to exit.
Add the following lines in the httpd.conf file at the end.
[root@server ~]#vi /etc/httpd/conf/http.conf
1010 Alias /squirrelmail /usr/share/squirrelmai
1011 <Directory /usr/shre/squirrelmail>
1012 Options Indexes FollowSymLinks
1013 RewriteEngine On
1014 DirectoryIndex index.php
1015 Order allow,deny
1016 Allow from all
1017 </Directory>
Restart the httpd service.
[root@server ~]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]

Create Users
[root@server ~]#useradd tom
[root@server ~]#passwd tom
Open the browser from any clients. Type the following in the address bar.
http://serveripaddress/webmail

or

http://yourdomainname/webmail


hello linuxquestions.org..i am so new to linux platform.this is how i created my mail server..it is running very good...i want to know the iptable rules for the above created mail server and selinux booleans..please to tell me those rules

Last edited by sasaditya; 03-30-2013 at 02:47 PM.
 
Old 03-30-2013, 03:28 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by sasaditya View Post
Configuring mail server with postfix,dovecot and squirrelmail in centos 6.3

hello linuxquestions.org..i am so new to linux platform.this is how i created my mail server..it is running very good...i want to know the iptable rules for the above created mail server and selinux booleans..please to tell me those rules
No idea, since you don't say what you want the rules to DO. Your question is far too vague...please provide context/details. Do you want to block the server from being a relay? Block external IP's from your LAN? Only allow certain IP's? What?
 
  


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
Mail Server on CentOs LeoPap Linux - Server 3 01-16-2013 01:00 PM
[SOLVED] How to convert OSX 10.5 Mini Server's Mail & mailboxes to CentOS linux server mail? tstfortruth Linux - Server 4 06-23-2012 01:33 AM
Mail server in centos!! anishkumarv Linux - Server 28 05-08-2012 01:05 AM
centos Mail server error George Mlagara Linux - Newbie 3 02-19-2012 11:19 AM
I'm looking a solution about mail server on CENTOS ThanhDuongCong Linux - Server 2 05-11-2009 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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