Tuesday, 02 December 2008
HughesJR.com
  Home arrow Guides arrow Guides arrow PostFix Install for CentOS-4 (WBEL-4 / TaoLinux-4 / RHEL-4) Part 3
Powered by CentOS
 
Main Menu
Home
Forum
Articles
Guides
News Feeds
Links
Search
Contact Us
Login Form





Lost Password?
No account yet? Register
Latest News
Popular
DS-Syndicate
feed image
PostFix Install for CentOS-4 (WBEL-4 / TaoLinux-4 / RHEL-4) Part 3 PDF Print E-mail
User Rating: / 5
PoorBest 
Written by Johnny Hughes   
Saturday, 30 September 2006
This is a guide to install a PostFix mailserver (with MailScanner, ClamAV, SquirrelMail, and SpamAssassin) on CentOS-4.X. There are 4 parts, this is part 3. This install procedure also works with White Box Enterprise Linux 4 and TaoLinux-4

Part 1 | Part 4


Below is the full text for part 3 of the guide. If you have any questions concerning this guide, please ask at the Postfix Mail Server of HughesJR.com.



Next comes adding squirrelmail to the server. This will require, at a minumum, squirrelmail, php, httpd and curl to be installed.

1. The first part is installing the new packages. The command to do that is:

yum install squirrelmail php httpd curl

2. The /etc/php.ini file needs to be editied and have the value register_globals set to on. Find register_globals = Off and change it to:

register_globals = On

Also in /etc/php.ini is the variable upload_max_filesize ... it is normally set to 2M (that is 2 mb) ... set this to the max size for your attachments....I'll assume 20M

upload_max_filesize = 20M
post_max_size = 20M
memory_limit = 20M

(you may need to adjust the post_max_size and memory_limit to be higher than 20M ... maybe as high as 40M to get 20M attachments.

3. You need to configure squirrelmail by doing the following:

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


select the options that you want in each area. This will make changes in the file /etc/squirrelmail/config.php. Here is some pointers on the setup:

You may need to turn off color to see the values that you enter in this aplication.
The type of imap server is uw if you installed dovecot, or cyrus if you used cyrus-imapd.

4. You must start the httpd server to run squirrel mail ... to make it start at every bootup, issue the command:

chkconfig httpd on

to start it now without rebooting, issue this command:

/etc/init.d/httpd start

5. You can download plugins from SquirrelMail.org.

6. To login to the squirrelmail, use http://your_servername/webmail/

7. The home directory of your webserver is still default at this point, you can add items to /var/www/html to get rid of the default page ... or change the /etc/httpd/conf/httpd.conf file to point directly to /usr/share/squirrelmail as it's root directory.

8. Just for info, this server is now only up to 749M of used hard drive space. (698Mb when starting with the Minimal install).

(Optional)Storing private addressbooks and preferences in a database


Next is the optional addition of a mysql database to store the address books and the preferences in for SquirrelMail. This is not required. You can see the full directions in the file /usr/share/doc/squirrelmail-x.x.x/db-backend.txt.

1. Now we need to add the path to the PEAR classes in our PHP include path ... edit the file /etc/php.ini and find the line:

;include_path = ".:/php/includes"

and change it to:

include_path = ".:/php/includes:/usr/share/pear"

2. Next we need to install the mysql database

yum install php-mysql mysql mod_auth_mysql mysql-server

After install, we need to make MySQL start at boot time ... and turn it on now with these commands:

chkconfig mysqld on
/etc/init.d/mysqld start


4. Now we need to create the a database in MySQL (named squirrelmail) with this command:

mysqladmin create squirrelmail

Then we will create a user that will write the information into the database. First enter mysql with this command:

mysql

You should now be at the mysql> prompt...issue this command:

GRANT select,insert,update,delete ON squirrelmail.* TO squirreluser@localhost IDENTIFIED BY 'sqpassword';
(you can substitute a different user for squirreluser and another password for sqpassword)

Next we will create the table where we will store the data. First, we want to select the database we will use to create our table in like this:

use squirrelmail

then paste this into the MySQL prompt (and press enter):

CODE
CREATE TABLE address (
owner varchar(128) DEFAULT '' NOT NULL,
nickname varchar(16) DEFAULT '' NOT NULL,
firstname varchar(128) DEFAULT '' NOT NULL,
lastname varchar(128) DEFAULT '' NOT NULL,
email varchar(128) DEFAULT '' NOT NULL,
label varchar(255),
PRIMARY KEY (owner,nickname),
KEY firstname (firstname,lastname)
);


While we are logged in as root, let's do the preferences table as well, paste this into the prompt:

CODE
CREATE TABLE userprefs (
user varchar(128) DEFAULT '' NOT NULL,
prefkey varchar(64) DEFAULT '' NOT NULL,
prefval BLOB DEFAULT '' NOT NULL,
PRIMARY KEY (user,prefkey)
);


Now exit mysql with the command quit.

5. Now we will configure squirrelmail to point to the databases like this:

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


In the menu, select Database, then select DSN for Address Book. Enter your string, mine is this:

mysql://squirreluser:sqpassword@localhost/squirrelmail

Now pick DSN for Preferences and enter the same thing again. (Remember, the format is mysql://user:password@host/database)

Restart the webserver with the command:

/etc/init.d/httpd restart and see if it works by logging into your http://your_servername/webmail

Next will be adding MailScanner with Spamassassin to filter incoming SPAM and Clam AntiVirus for scanning all incoming mail for viruses.

Part 1 | Part 4

 

 


Last Updated ( Sunday, 05 August 2007 )
 

© 2008 HughesJR.com
Powered by CentOS