The blog includes a vivid coverage of the concepts of CCNA, CCNP (Routing & Switching) , Basic Linux and Linux servers. Projects have also been simulated to give a practical exposure.

Saturday 15 March 2014

Configure Squirrelmail

1 comment


Prerequisites
Http should be installed.
If you want to keep SELinux on, then enter the following command in Terminal:

# togglesebool httpd_can_network_connect

Make changes in this file for Http.

# vi /etc/sysconfig/iptables
[...]
 -I INPUT 1 -p tcp --dport 80 -j ACCEPT
 -I INPUT 1 -p tcp --dport 443 -j ACCEPT
[...]

Install Postfix
Let us install postfix package using the command:

# yum install postfix -y

Configuring Postfix

Edit /etc/postfix/main.cf,
# vi /etc/postfix/main.cf

find and edit the following lines:

Line no 75 - Uncomment and set your mail server FQDN
myhostname = server.stpi.in

Line 83 - Uncomment and Set domain name
mydomain = stpi.in

Line 99 - Uncomment
myorigin = $mydomain

Line 116 - Set ipv4
inet_interfaces = all

Line 119 – Chech it should be for all
inet_protocols = all

Line 164 - Comment
#mydestination = $myhostname, localhost.$mydomain, localhost,

Line 165 - Uncomment
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

Line 264 - Uncomment and add IP range (in this only these network can access your website)
According to me let it remain as comment.
#mynetworks = 192.168.1.0/24, 127.0.0.0/8

Line 419 - Uncomment
home_mailbox = Maildir/

Save and exit the file. Start/restart Postfix service now:

# service postfix restart
# chkconfig postfix on

Testing Postfix mail server

First, create a test user called “vishu“.

# useradd vishu
# passwd vishu

Access the server via Telnet and enter the commands manually shown in red colored text.

# telnet localhost smtp
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 server.stpi.in ESMTP Postfix
ehlo localhost     #type this command #
250-server.stpi.in
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

It means its working.

Installing Dovecot

Dovecot is an open source IMAP and POP3 mail server for Unix/Linux systems. To install:

# yum install dovecot

Configuring Dovecot

Edit the file /etc/dovecot/dovecot.conf file,
# vi /etc/dovecot/dovecot.conf

Line 20 - umcomment
protocols = imap pop3 lmtp

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

Line 24 - uncomment
mail_location = maildir:~/Maildir

Edit /etc/dovecot/conf.d/10-auth.conf
# vi /etc/dovecot/conf.d/10-auth.conf 

line 9 - uncomment
disable_plaintext_auth = yes

Line 97 - Add a letter "login"
auth_mechanisms = plain login

Start Dovecot service:

# service dovecot start
# chkconfig dovecot on

Testing Dovecot

It’s time to test Dovecot configuration. Enter the following command in Terminal:

# telnet localhost pop3
Enter the commands manually marked in red color:
Trying ::1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
user vishu    # log in as user vishu #
+OK
pass vishu     # input user password #
+OK Logged in.
quit
+OK Logging out.
Connection closed by foreign host.

As you see in the above, Dovecot is working!

Working with mail in command modes little bit difficult for us. So we will install a webmail client called Squirrelmail to send/receive emails via a web browser.

Installing Squirrelmail


Configuring Squirrelmail

Navigate to /usr/share/squirrelmail/config/ directory and run the command conf.pl:

# cd /usr/share/squirrelmail/config/
# ./conf.pl

This screen will come
Type 1 to make changes in organization Preferences



After pressing 1 this screen will come.


Type 1 to change Organization Name.
Server Setting 

Folder Setting

And other should be remain same. 

Create a squirrelmail vhost in apache config file:

# vi /etc/httpd/conf/httpd.conf
Add the following lines at the end:



Restart the Apache service:
# service httpd restart
 
Access Webmail
Now navigate to http://ip-address/squirrelmail or http://domain-name/squirrelmail from your browser. The following screen should appear. Enter the username and password of the user.

  
By :- Vishal Sharma

1 comment :

  1. Well.... i am searching this from last few months... :) (y)

    ReplyDelete