Create.vmail.sql
USE mysql;
REPLACE INTO user (host, user, password)
VALUES ( 'localhost', 'vmail_admin', PASSWORD('SuperSecret')
);
REPLACE INTO db (host, db, user, select_priv, insert_priv, update_priv,
delete_priv, create_priv, drop_priv, index_priv) VALUES ( 'localhost', 'vmail', 'vmail_admin', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y'
);
-- Make sure that priviliges are reloaded. FLUSH PRIVILEGES;
-- we're assuming the database does not exist yet CREATE DATABASE vmail;
USE vmail;
CREATE TABLE domains (
domain VARCHAR(50) NOT NULL,
PRIMARY KEY (domain) ) TYPE=MyISAM;
CREATE TABLE forwardings (
source VARCHAR(80) NOT NULL, destination TEXT NOT NULL,
PRIMARY KEY (source) ) TYPE=MyISAM;
CREATE TABLE users (
emailaddr VARCHAR(80) NOT NULL, passwd VARCHAR(30) NOT NULL,
PRIMARY KEY (emailaddr) ) TYPE=MyISAM;
CREATE TABLE relaydomains (
rdomain VARCHAR(80) NOT NULL, transport VARCHAR(80) NOT NULL,
PRIMARY KEY (rdomain) ) TYPE=MyISAM;
FLUSH PRIVILEGES;