Any recommended open-source project to continuously ingest e-mail (iMAP, POP) into a database? The specific database engine is not important but prefer JSON.
How about starting with something like this:<p><pre><code> 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
);
</code></pre>
in SQLite? (But in my opinion, storing in e.g. Lucene as full-text indexed text collection makes more sense for fast & flexible search.)<p>EDIT: Python, PHP and Perl have libraries to read MBOX format and write SQLite easily (= elss than a screen of code).
I've been playing with emails just recently and what struck me most was the hellish inconsistency of the emails themselves. You will find "body" is a rabbit hole all of its own. Good luck!