Está en la página 1de 8

202.59.128.

254 8080
g - Match globally
i- Cae-insensitive match
s- Treat string as single line
m- Treat string as multiple lines
o- only compile pattern once
===========================================================================
SETUP MAIL SERVER USING POSTFIX DOVECOT AND SQUIRRELMAIL in Centos
/RHEL/ Scientific Linux 6.3 step by step..............
Step 1. - Before installing postfix, remove sendmail from the server.
Because sendmail is the
default MTA in Redhat / Centos
[root@server~] # yum remove sendmail
Prerequisites :
1) The mail server should contain a valid MX record in the DNS server.
2) Firewall and selinux should be disabled.
[bash]# service iptables stop
[bash]# service ip6tables stop
[bash]# chkconfig iptables off
[bash]# chkconfig ip6tables off
[bash]# vi /etc/selinux/config
# This file controls the state of Selinux on the system
# SELINUX= can take one of these three values
# enforcing - SELINUX security policy is enforced
# permissive - SELINUX prints warnings instead of enforcing
# disabled - No Selinux policy is loaded.
SELINUX=disabled
#SELINUXTYPE= can take one of these two values :
# targeted - Targeted processes are protected.
# mls - Multi level security protection.
SELINUXTYPE=targeteted.
:wq
Step 2 : Reboot the server .
--------------------------------------------------------------------------------
--------------------
Scenario
In this tutorial my test box
Hostname =server.ostechnix.com
IP address : 192.168.1.200/24
And my server is configured with proper MX record in DNS server
Installation
---------------
[bash]# yum install postfix
Configuration
-------------------
Open the postfix config file /etc/postfix/main.cf. Find the below lines and edit
them as shown below:-
[bash]# vi /etc/postfix/main.cf
myhostname = server.ostechnix.com ## Line no. 75 - uncmment and enter your host
name
mydomain = ostechnix.com ## Line no. 83 - uncomment and enter your domain name
myorigin = $mydomain ## Line no. 99 - uncomment
inet_interfaces = all ## line no. 116- change to all
mydestination = $myhostname , localhost.$mydomain, llocalhost, $mydomain ## lin
e no 164 - add $domain at the end
mynetworks= 192.168.1.0/24 , 127.0.0.1/8 ## line no. 204 - uncomment the line
home_mailbox = Maildir/ ## line no. 419 - uncomment
-----------------------------------------------------------------

[bash]# service postfix start
starting postfix:
[ OK ]

[bash]# chkconfig postfix on
Test Postfix
The commands shown in bold letters should be entered by the user
[root@server ~]# telnet localhost smtp
Trying ::1......
Connected to localhost.
Escape character is '^]'
220 server.ostechnix.com ESMTP Postfix
>> echo localhost
250-srever.ostechnix.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
> mail from : <user1>
250 2.1.0 ok
data
354 End Data with <CR><LR>.<CR><LF>
test
.
250 2.0.0 Bye
connection closed by the foreign host
Check mail
Navigate to the user mail directory and check for the new mail.
[root@server ~]# cd /home/user1/Maildir/new
[root@server new] ls
1360236956.Vfd<>.server.ostechnix.com
[bash]# cat server.ostechnix.com
return-path: <user1@ostechnix.com>
X-original-to: user1
delivered-To: user1@ostechnix.com
Received : from localhost (localhost [IPv^:::1])
================================================================================
======================================
Installing dovecot
[step1]
[root@server ~] yum install dovecot
[step2]
[root@server ~] vi /etc/dovecot/dovecot.conf
protocols = imap pop3 lmtp
Open the file /etc/dovecot/conf.d/10-mail.conf and uncomment the line a shown b
elow :-
[root@server ~]# vi /etc/dovecot/conf.d/10-mail.conf
mail_location =maildir:~/Maildir ## line no 24 - uncomment
Open the /etc/dovecot/conf.d/10-auth.conf and edit as shown below :-
[root@server ~]# vi /et/dovecot/conf.d/10-auth.conf
disable_plaintext_auth = no ## line no 9 -uncomment and change from yes to no
auth_mechanisms = plain login ## line no 97 - add the text "login"
Open the /etc/dovecot/conf.d/10-master.conf and edit as shwn below :-
unix_listener auth-userdb {
#mode = 0600
user = postfix ## line no. 83 - uncomment and enter postfix
group = postfix ## line no. 84 - uncomment and enter postfix
>>> Start the dovecot service
[root@server ~]# service dovecot start
Starting Dovecot Imap: [ OK ]
[root@server ~]#chkconfig dovecot on
--------------------------------------------------------------------------------
--------------------------------------
Test Dovecot
[root@server ~] telnet localhost pop3
Trying ::1.....
Connected to localhost....
Escape character is '^]'
+OK Dovecot ready
user user1
+OK
pass user1
+OK Logged in
list
+OK 1 messages
1 428
.
retr 1
+OK 428 octets
return-Path: <user1@ostechnix.com>
X-original-To: user1
Delivered-To: user1@ostechnix.com
received from localhost (localhost [IPv6:::1])
by server.ostechnix.com(Postfix) with ESMTP id 117113FF18
for <user1>; Thu, 7 Feb 2013 17:05:32 +0530 (IST)
From: user1@ostechnix.com
To: undisclosed-recipients:;
test
.
quit
+OK Logging out
Connection closed by foreign host.
dovecot is working fine
==================================================
Install squirrelmail
[root@server ~]# yum install squirrelmail.
Go to the squirrelmail config directory and use the command ./conf.pl to start
configure as shown belw :--
[root@server~]# cd /usr/share/squirrelmail/config/
[root2server config]# ./conf.pl
SquirrelMail Configuration : Read: Conffig.php (1.4.0)
-----------------------------------------------------------------------------
Main Menu ---
1. Organisation 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
==============================================================================
DNS server installation in CentOS 6.3
Scenario
Operating System : CentOS 6.3 23 bit (Minimal Serve
r)
Hostname : masterdns.ostechnix.com
IP Address : 192.168.1.200/24
Secondary (slave) dns server details:
operating system : Centos 6.3 32 bit (Minimal serve
r)
Hostname : slavedns.ostechnix.com
ip address : 192.168.1.201/24
--------------------------------------------------------------------------------
-------------------------
Setup Primary (Master) DNS Server
[bash]# yum install bind* -y
1. Configure DNS Server
[bash]# vi /etc/named.conf
options {
listen-on port 53 { 127.0.0.1; 192.168.1.200;};
allow-query { localhost; 192.168.1.0/24;};
allow-transfer { localhost; 192.168.1.201;};
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
bindkeys-file "/etc/named.iscdlv.key";
managed-keys-directory "/var/named/dynamic";
};

También podría gustarte