Messages.dat

Messages.dat is an SQLite database containing messages and some configuration.

Location
Please refer to the Keys.dat article for the location.

Tables
Below is a list of Tables and their creation SQL command.

inbox
Contains Messages that were successfully decrypted. Contains trashed received messages too. CREATE TABLE inbox (   msgid blob,    toaddress text,    fromaddress text,    subject text,    received text,    message text,    folder text,    encodingtype int,    read bool, UNIQUE(msgid) ON CONFLICT REPLACE)

sent
Contains Messages that were sent. Contains trashed sent messages too. CREATE TABLE sent (   msgid blob,    toaddress text,    toripe blob,    fromaddress text,    subject text,    message text,    ackdata blob,    lastactiontime integer,    status text,    pubkeyretrynumber integer,    msgretrynumber integer,    folder text,    encodingtype int )

subscriptions
Contains Addresses the user is subscribed to. CREATE TABLE subscriptions (   label text,    address text,    enabled bool )

addressbook
Contains the users address book CREATE TABLE addressbook (   label text,    address text )

blacklist
Contains blacklisted addresses CREATE TABLE blacklist (   label text,    address text,    enabled bool )

whitelist
Contains whitelisted addresses CREATE TABLE whitelist (   label text,    address text,    enabled bool )

inventory
Contains pubkeys and messages received CREATE TABLE inventory (   hash blob,    objecttype text,    streamnumber int,    payload blob,    receivedtime integer, UNIQUE(hash) ON CONFLICT REPLACE)

knownnodes
Empty table. Will probably contain known nodes once the system is developed and deployed further. Currently the knownnodes.dat is used instead. CREATE TABLE knownnodes (   timelastseen int,    stream int,    services blob,    host blob,    port blob, UNIQUE(host, stream, port) ON CONFLICT REPLACE)

settings
Contains some settings, currently the version (probably of the database) and the time the database was last cleaned up CREATE TABLE settings (   key blob,    value blob, UNIQUE(key) ON CONFLICT REPLACE)

pubkeys
Contains public keys created by the user and the time it was last transmitted. CREATE TABLE pubkeys (   hash blob,    transmitdata blob,    time int,    usedpersonally text, UNIQUE(hash) ON CONFLICT REPLACE)

Deleted messages
Internally a message is deleted by setting its folder to "trash" but leaving it in its table. The current version has an option to delete trashed messages definitely, this also shrinks the database. Allows the user to clean up the database more than once per month.