SquirrelMail can use a database backend like MySQL to store address books and preferences. This article describes how to configure SquirrelMail to use a MySQL address book.
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
1. Install the requirements using the command below.
Clik here to view.

Clik here to view.

yum install mysql-server php-pear-DB
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
2. Start the mysqld service. Learn how to start and stop services here.
Clik here to view.

Clik here to view.

Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
3. Launch the MySQL command line tool using the command below.
Clik here to view.

Clik here to view.

mysql -u root -pThe default root password of MySQL is a blank password. Next, create a new MySQL database for SquirrelMail using the commands below.
mysql> CREATE DATABASE squirrelmail; mysql> CREATE USER squirrelmail@localhost IDENTIFIED BY 'your_password'; mysql> GRANT ALL PRIVILEGES ON squirrelmail.* TO squirrelmail; mysql> USE squirrelmail; mysql> 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) ); mysql> CREATE TABLE global_abook ( 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) );
Image may be NSFW.
Clik here to view.
Image may be NSFW.
Clik here to view.
4. Configure SquirrelMail the command below.
Clik here to view.

Clik here to view.

/usr/share/squirrelmail/config/conf.pl
Select menu 9, Database and update the values of the following.
- DSN for Address Book : mysql://squirrelmail:password@localhost/squirrelmail
- DSN for Global Address Book : mysql://squirrelmail:password@localhost/squirrelmail
- Allow writing into Global Address Book : true
- Allow listing of Global Address Book : true
Then save your changes. Your address book should now be stored in MySQL.