How to configure squirrel mail

Posted by Md. Mahidul Hasan on 3:30 AM with 3 comments
HOW TO CONFIGURE SQUIRREL MAIL:

1. Install apache webserver
 # apt-get install apache2
 # apt-get install php5

2. Now we will download squirrel mail tar.gz file
# wget http://sourceforge.net/projects/squirrelmail/files/stable/1.4.21/squirrelmail-1.4.21.tar.gz
it will download the squirrelmail file in postfix directory. Lets check with ls command.

3. Copy the downloaded file to /var/www directory....
# cp squirrelmail-1.4.21.tar.gz /var/www

4. Now Change directory to /var/www
# cd /var/www

5. Now we will extract the downloaded tar.gz file
# tar -zxvf squirrelmail-1.4.21.tar.gz

6. Rename squirrelmail-1.4.21 folder to webmail
# mv squirrelmail-1.4.21 webmail

7. Now change directory to webmail
# cd webmail

8. We will now configure webmail....
#./configure

Here the Config begins:
Command>> 1  [for organization preference]
again Command >> 1 [enter organization name suppose Mehedi Group]
command >> 2 [for organization Logo] press S for save and R for return to main menu.

Now from Main Menu....
Command >> 1 [enter Domain name mehedi.com]
Please save the changes and return to main menu.

Now from Main Menu....
Command >> 4 [it will enter General options]
Command >> 1 [to change the Data Directory to /var/www/webmail/data/  ]
Command >> 2 [to change the attachment   Directory to /var/www/webmail/attach/ ]

*** Don't forget to create a folder named attach in webmail directory.
# cd /var/www/webmail
# makdir attach

9. Save the changes and return to the main menu and then exit from webmail configuration..... Finally....
   # cd.. [for go to previous directory... now we will be at /var/www/ directory...]
   # chown -R www-data:www-data webmail/
   # cd /var/www/webmail/
   # chown -R www-data:www-data data/
   # chown -R www-data:www-data attach/

11. Restart the services,
   # /etc/init.d/apache2 restart
   # /etc/init.d/postfix restart
   # /etc/init.d/dovecot restart

If your squirrel mail open a download file instead opening the web interface install the following package and restart apache2.

# apt-get install apache2-mpm-prefork
# /etc/init.d/apache2 restart

Of course remove your browser's cache. Now go to web browser and type: http://192.168.0.2/webmail

ha ha ha you find the Squirrell mail login page...hopefully....

12. Auto-Redirect Squirrelmail to the index page
# vim /var/www/index.html

<HTML><HEAD>
<TITLE>Auto-Redirect Page for Webmail</TITLE>
<meta http-equiv="Refresh" content="0; URL=http://192.168.1.1/webmail/">
</HEAD><BODY>
</body>
</html>

13. Increase squirrelmail attachment size:
By default Squirrel mail (webmail) has maximum attachment size limit 2MB. But in our daily mail transactions we need to send large files as attachment.

To increase the attachment size edit /etc/php5/apache2/php.ini file.
# vim /etc/php5/apache2/php.ini

upload_max_filesize = 2M [increase the size as you need]
post_max_size = 20M [increase the size as you need]

save and close.

Now restart apache.
#/etc/init.d/apache2 restart

Changing password and save company logo:
root@mail:~# apt-get install poppassd
root@mail:~# cd /var/www/webmail/
root@mail:~# wget http://www.squirrelmail.org/plugins/change_pass-2.7a-1.4.x.tar.gz
root@mail:~# tar -zxvf change_pass-2.7a-1.4.x.tar.gz
root@mail:~# cd ..
root@mail:~# ./configure
Move the plugin change_pass\94 from available plugins to installed plugins. Changing password option should be available in the options menu under squirrelmail. Logo location: /var/www/webmail/images/sm_logo.png. If there is a problem, try rebooting the server.

14. webmail change password in linux
I was working with squirrelmail change password plugin on RHEL 5. Though it works, I know, but unfortunately it was not working on that day. I have tried all the possible ways but failed. Then I have to go for alternate way and did changepassword on that server. Here is how I did it.

Download it on your server.
# wget  <the link for changepassword-0.9.tar.gz>

untar the file:
# tar \96zxvf  changepassword-0.9.tar.gz

Now enter the directory do the following steps (I have a cgi-bin dir in /var/www):
# cd changepassword-0.9
# ./configure \96help
# ./configure --enable-cgidir=/var/www/cgi-bin --disable-smbpasswd --disable-squidpasswd
# make && make install

Now open the page with the follwing URL and change your password:
http://<your-server-IP>/cgi-bin/changepassword.cgi

To make easier for user we have to change the path:
# mkdir /var/www/changepass
# cd /var/www/changepass

vim index.html

## type the following lines in this file and save it ##
<HTML><HEAD>
<TITLE>Webmail Password change</TITLE>
<meta http-equiv="Refresh" content="0; URl=http://<your-server-ip>/cgi-bin/changepassword.cgi">
</HEAD><BODY>
</body>
</html>

Now restart the apache service and open the below URL:
http://<your-server-ip>/changepass/

****Note: If you download squirrelmail by apt-get install method it may occur some difficulties later on.
But the way is:
# apt-get install squirrelmail  (To download & install)
# squirrelmail-configure  (To configure)