3 ms·
How about starting with something like this: CREATE TABLE email( id INTEGER AUTOINCREMENT NOT NULL PRIMARY KEY, s_id INTEGER, r_id
by jll29 2y ago
How about starting with something like this:
CREATE TABLE email(
id INTEGER AUTOINCREMENT NOT NULL PRIMARY KEY,
s_id INTEGER,
r_id INTEGER,
subject VARCHAR,
header VARCHAR,
body VARCHAR
);
CREATE TABLE contacts(
id INTEGER AUTOINCREMENT NOT NULL PRIMARY KEY,
email. VARCHAR NOT NULL,
name VARCHAR
);
CREATE TABLE attachments(
id INTEGER AUTOINCREMENT NOT NULL PRIMARY KEY,
email_id INTEGER NOT NULL,
attachm BLOG NOT NULL
);
in SQLite? (But in my opinion, storing in e.g. Lucene as full-text indexed text collection makes more sense for fast & flexible search.)
EDIT: Python, PHP and Perl have libraries to read MBOX format and write SQLite easily (= elss than a screen of code).
- nodesocket 2y agoThe schema is not really the challenge, more about constantly polling POP and iMAP and parsing emails.