# mysqladmin create squirrelmail
(from the mysql client)
- mysql> GRANT select,insert,update,delete ON squirrelmail.*
- TO squrreluser@localhost IDENTIFIED BY 'sqpassword';
+ mysql> GRANT select,insert,update,delete ON squirrelmail.*
+ TO squirreluser@localhost IDENTIFIED BY 'sqpassword';
The table structure should be similar to this (for MySQL):
KEY firstname (firstname,lastname)
);
+and similar to this for PostgreSQL:
+CREATE TABLE "address" (
+ "owner" varchar(128) NOT NULL,
+ "nickname" varchar(16) NOT NULL,
+ "firstname" varchar(128) NOT NULL,
+ "lastname" varchar(128) NOT NULL,
+ "email" varchar(128) NOT NULL,
+ "label" varchar(255) NOT NULL,
+ CONSTRAINT "address_pkey" PRIMARY KEY ("nickname", "owner")
+);
+CREATE UNIQUE INDEX "address_firstname_key" ON "address"
+ ("firstname", "lastname");
+
Next, edit your configuration so that the address book DSN (Data Source
Name) is specified, this can be done using either conf.pl or via the
administration plugin. The DSN should look something like:
- $addrbook_dsn = 'mysql://squirreluser:sqpassword@localhost/squirrelmail';
+ mysql://squirreluser:sqpassword@localhost/squirrelmail or
+ pgsql://squirreluser:sqpassword@localhost/squirrelmail
From now on all users' personal addressbooks will be stored in a
database.
-
+Global address book uses same table format as the one used for personal
+address book. You can even use same table, if you don't have user named
+'global'.
Configuring preferences in database
-----------------------------------
-There is no easy way to do this yet. You will have to remove
-functions/prefs.php and replace it with functions/db_prefs.php. Then
-edit the new functions/prefs.php (db_prefs.php) and change the $DSN to
-point to a database you create (can be the same you use for
-addressbooks). Create a table similar to this (for MySQL):
+This is done in much the same way as it is for storing your address
+books in a database.
+
+The table structure should be similar to this (for MySQL):
CREATE TABLE userprefs (
user varchar(128) DEFAULT '' NOT NULL,
PRIMARY KEY (user,prefkey)
);
+and for PostgreSQL:
+CREATE TABLE "userprefs" (
+ "username" varchar(128) NOT NULL,
+ "prefkey" varchar(64) NOT NULL,
+ "prefval" text,
+ CONSTRAINT "userprefs_pkey" PRIMARY KEY ("prefkey", "username")
+);
-Default preferences can be set by altering the $default array in
-prefs.php (db_prefs.php).
+Next, edit your configuration so that the preferences DSN (Data Source
+Name) is specified, this can be done using either conf.pl or via the
+administration plugin. The DSN should look something like:
+
+ mysql://squirreluser:sqpassword@localhost/squirrelmail or
+ pgsql://squirreluser:sqpassword@localhost/squirrelmail
+From now on all users' personal preferences will be stored in a
+database.
+
+Default preferences can be set by altering the $default array in
+db_prefs.php.