POSTFIX, DOVECOT AND SQUIRREMAIL CONFIGURATION..

1- Configure Postfix Server
POSTFIX SERVER [MAIL SERVER] Remote or central computer that holds electronic mail (e-mail) messages for clients on a network. When the user requests his or her e-mail they contact the mail server, which delivers to the client computer all mail being stored.


Package-       Postfix
Port no -        25 [smtp]
Script-            /etc/init.d/postfix
Daemon-        Postfix
Config file-     /etc/postfix/main.cf

# yum install postfix* -y


#  vim /etc/postfix/main.cf
myhostname = server-1.ashu.com        [uncomment this line and add it line no 75]
mydomain = example.com                     [uncomment it add this line 83]
myorigin = $mydomain                            [uncomment it line no 99]
inet_interfaces = all                                  [uncomment it line no 113]
#inet_interfaces = localhost                    [comment it line no 116]
 $mydomain                                               [add this end of line no 164]
mynetworks = 192.168.0.0/24, 127.0.0.0/8     [uncomment it and add network add l-264

:wq
 

# etc/init.d/postfix restart;chkconfig postfix on          (Restart Services)
# mail root@ashu.com
Subject: hi
hi this is the testing mail by mail server  {ctrl-d 2 times for save]

# mail
Heirloom Mail version 12.4 7/29/08.  Type ? for help.
"/var/spool/mail/root": 1 message 1 new
>N  1 root                  Sun Aug 19 16:57  18/597   "hi"
& 1
Message  1:
From root@ashu.com  Sun Aug 19 16:57:53 2012
Return-Path: <root@ashu.com>
X-Original-To: root@ashu.com
Delivered-To: root@ashu.com
Date: Sun, 19 Aug 2012 16:57:53 +0530
To: root@ashu.com
Subject: hi
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: root@ashu.com (root)
Status: R

hi this is the testing mail by mail server.

& exit
You have mail in /var/spool/mail/root
 

# adduser delhi
# passwd delhi
 redhat
 redhat
# mail delhi@ashu.com
Subject: by root
hi user delhi how are you.  {ctrl+d 2 times]

# su - delhi
$ mail

Heirloom Mail version 12.4 7/29/08.  Type ? for help.
"/var/spool/mail/delhi": 1 message 1 new
>N  1 root                  Sun Aug 19 17:02  18/588   "by root"
& 1
Message  1:
From root@ashu.com  Sun Aug 19 17:02:35 2012
Return-Path: <root@ashu.com>
X-Original-To: delhi@ashu.com
Delivered-To: delhi@ashu.com
Date: Sun, 19 Aug 2012 17:02:34 +0530
To: delhi@ashu.com
Subject: by root
User-Agent: Heirloom mailx 12.4 7/29/08
Content-Type: text/plain; charset=us-ascii
From: root@ashu.com (root)
Status: R

hi user delhi how are you.

$ exit


MAIL ALIASES-

An email alias is simply a forwarding email address.

# adduser user2
# passwd user2

# vim /etc/aliases

www:                 webmaster
webmaster:      root
noc:                   root
security:            root
hostmaster:      root
info:                   postmaster
marketing:        postmaster
sales:                postmaster
support:            postmaster
delhi:                user2

:wq
 

# newaliases 

NOTE- now you will send a mail to delhi user and it will transfer to user2.

# su - user2
# mail       ( It will show the mail which send by root user to delhi user])
 


Now Working.........
_____________________________________________________________________________________________
Click Back..                                Click Home..


https://docs.google.com/forms/d/1iNRZlJJO6rBFizzPcFmyOTEtfkdjhdVRmpM74IbiT3o/viewform



 
                        2. Configure Dovecot Server

Dovecot-  
Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind


1- Install Package
 

 # yum install dovecoat* -y

2- Open Config File

# vim /etc/dovecot/dovecot.conf

protocols = imap pop3 lmtp





3- Open the file /etc/dovecot/conf.d/10-mail.conf and uncomment the line as shown below.


# vi /etc/dovecot/conf.d/10-mail.conf



4- Open the /etc/dovecot/conf.d/10-auth.conf and edit as shown below.

 
# vi /etc/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 shown 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)

5-Start the dovecot service.

 
# service dovecot start
Starting Dovecot Imap:                                     [  OK  ]
# chkconfig dovecot on 

 

Test Dovecot-

The commands shown in bold should be entered by the user.


# 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@ashu.com>
X-Original-To: user1
Delivered-To: user1@ashu.com
Received: from localhost (localhost [IPv6:::1])
 by server-1.ashu.com (Postfix) with ESMTP id 117113FF18
 for <user1>; Thu,  7 Feb 2013 17:05:32 +0530 (IST)
Message-Id: <20130207113547.117113FF18@server-1.ashu.com>
Date: Thu,  7 Feb 2013 17:05:32 +0530 (IST)
From: user1@ashu.com
To: undisclosed-recipients:;
test
.
quit 
+OK Logging out.
Connection closed by foreign host.
[root@server ~]# 



Now Working.........

_____________________________________________________________________________________________
Click Back..                                Click Home..


https://docs.google.com/forms/d/1iNRZlJJO6rBFizzPcFmyOTEtfkdjhdVRmpM74IbiT3o/viewform

 


 


                        3. Configure
Squirrelmail Server
 
SquirrelMail-


SquirrelMail is an Open Source project that provides both a web-based email application and an IMAP proxy server.

 

Install EPEL repository first. And install SquirrelMail package from EPEL repository.

 
# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm 
# yum install squirrelmail
# service httpd start
Starting httpd:                                            [  OK  ]
# chkconfig httpd on

Configure Squirrelmail


Go to the squirrelmail config directory and use the command ./conf.pl to start configure as shown below.

 
# cd /usr/share/squirrelmail/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      : Ostechnix
2.  Organization Logo      : ../images/sm_logo.png
3.  Org. Logo Width/Height : (308/111)
4.  Organization Title     : Welcome to Ostechnix webmail
5.  Signout Page           : 
6.  Top Frame              : _top
7.  Provider link          : http://ostechnix.com
8.  Provider name          : Ostechnix
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                 : ostechnix.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
Command >> S

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.

 
# vi /etc/httpd/conf/httpd.conf
Alias /squirrelmail /usr/share/squirrelmail
<Directory /usr/share/squirrelmail>
    Options Indexes FollowSymLinks
    RewriteEngine On
    AllowOverride All
    DirectoryIndex index.php
    Order allow,deny
    Allow from all
</Directory>

Restart the httpd service. 

 
# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

Create Users


# useradd user1
# useradd user2
# passwd user1
# passwd user2

Open the browser from any clients. Type the following in the address bar.

http://serveripaddress/webmail

or

http://yourdomainname/webmail
 


Now let us compose a mail from user1 to user2. Refer a below screenshot.


Then sign-out and sign-in back from user2. 




Thats it. We have got a mail from user1. If you have any issues in the configuration, post them in the comment section.

Have a good day.



Now Working.........

_____________________________________________________________________________________________
Click Back..                                Click Home..


https://docs.google.com/forms/d/1iNRZlJJO6rBFizzPcFmyOTEtfkdjhdVRmpM74IbiT3o/viewform