Solved Local archive of IMAP server

there is still the tension/relationship between the mailboxes and tags
I do not know how mail/notmuch implement tags. But independent of the storage
format, each mail has a supposed unique mailid, much more if you do a table in which each row
corresponds to one and only one mail in the archive.

You can implement tagging with a table with two fields per record: id of mail (on the left) and tagname
(on the right). Mathematically is just a relation. For each tag on the right you have many mails (mailids)
on the left. And for each mail(id) on the left you have many tags on the right.

I suspect that mail/notmuch take a lot of space indexing. If one decides to put the body
in the db, one could also use:


In any case, sql is very powerfull, making for example threading of the mails is just few lines of code.
 
Hi hruodr,

re the tags, as I currently understand it, there are unique maildir flags in the (unique) message filenames. There is a settings in the notmuch-config, synchronizing the maildir flags with the notmuch flags.

I am not sure why would one need a(nother) database as you propose. The mail/notmuch creates its own database, and when one performs a search, the result is a set of messages and corresponding search tags. So, unless I am missing something, it does exactly what you propose.

Kindest regards,

M
 
re the tags, as I currently understand it, there are unique maildir flags in the (unique) message filenames. There is a settings in the notmuch-config, synchronizing the maildir flags with the notmuch flags.
Sure you can use your own tags in notmuch. There is a command to dump them for saving them
when you want to delete the db, that, because your own tags are not in the maildir.

I am not sure why would one need a(nother) database as you propose.

notmuch uses Xapian as search engine, I proposed to use sqlite3. You need to feed data to these software
in the way they want the data. They do not read maildir, mboxes, mh directories, etc. notmuch calls it
indexing.
 
H hurodr,

notmuch uses Xapian as search engine, I proposed to use sqlite3.
I have misread your intention. You want to design an implement your own solution with sqlite3, instead of using a ready-made one. Makes sense to me now.

Kindest regards,

M
 
Back
Top