Professional Documents
Culture Documents
Prerequisites:
The mail server should contain a valid MX record in the DNS server. Navigate to this
link how to setup DNS 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
Postfix is installed by default. If it is not installed, use the below command to install postfix.
[root@server ~]# yum install postfix
Configuration
Open the postfix config file /etc/postfix/main.cf. Find the below lines and edit them as shown
below.
OK
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:<user1>
250 2.1.0 Ok
rcpt to:<user1>
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
test
.
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.
Install Dovecot
[root@server ~]# yum install dovecot
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
protocols = 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
mail_location = maildir:~/Maildir ##line no 24 - uncomment
unix_listener auth-userdb {
#mode = 0600
user = postfix ##line no 83 - uncomment and enter postfix
group = postfix ##line no 84 - uncomment and enter postfix
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 user1
+OK
pass user1
+OK Logged in.
list
OK
+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)
Message-Id: <20130207113547.117113FF18@server.ostechnix.com>
Date: 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.
[root@server ~]#
Install Squirrelmail
Install EPEL repository first. And install SquirrelMail package from EPEL repository.
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
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
Create Users
[root@server
[root@server
[root@server
[root@server
~]#
~]#
~]#
~]#
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
[
[
OK
OK
]
]
Now let us compose a mail from user1 to user2. Refer a below screenshot.
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.