Table 1 SQL Commands (email.sql)
CREATE DATABASE email;
USE email;
GRANT ALL ON email.* TO 'mailuser' IDENTIFIED BY 'secret';
CREATE TABLE msg (
id INT(11) NOT NULL AUTO_INCREMENT,
message_id VARCHAR(255),
to_addr VARCHAR(255),
fr_addr VARCHAR(255),
subject VARCHAR(255),
date1 VARCHAR(255),
date2 VARCHAR(255),
mime_type VARCHAR(255),
body_text LONGTEXT,
body_html LONGTEXT,
raw LONGTEXT,
size INT(11),
recd DATETIME,
PRIMARY KEY (id),
UNIQUE KEY (message_id)
);
CREATE TABLE attach (
id INT(11) NOT NULL AUTO_INCREMENT,
msg_id INT(11),
mime_type VARCHAR(255),
filename VARCHAR(255),
size INT(11),
stamp TIMESTAMP(14) NOT NULL,
PRIMARY KEY (id)
);
ALTER TABLE msg ADD INDEX (fr_addr);
ALTER TABLE msg ADD INDEX (date2);
ALTER TABLE msg ADD INDEX (recd);
|