mox/message
Mechiel Lukkien 3fb41ff073
implement message threading in backend and webmail
we match messages to their parents based on the "references" and "in-reply-to"
headers (requiring the same base subject), and in absense of those headers we
also by only base subject (against messages received max 4 weeks ago).

we store a threadid with messages. all messages in a thread have the same
threadid.  messages also have a "thread parent ids", which holds all id's of
parent messages up to the thread root.  then there is "thread missing link",
which is set when a referenced immediate parent wasn't found (but possibly
earlier ancestors can still be found and will be in thread parent ids".

threads can be muted: newly delivered messages are automatically marked as
read/seen.  threads can be marked as collapsed: if set, the webmail collapses
the thread to a single item in the basic threading view (default is to expand
threads).  the muted and collapsed fields are copied from their parent on
message delivery.

the threading is implemented in the webmail. the non-threading mode still works
as before. the new default threading mode "unread" automatically expands only
the threads with at least one unread (not seen) meessage. the basic threading
mode "on" expands all threads except when explicitly collapsed (as saved in the
thread collapsed field). new shortcuts for navigation/interaction threads have
been added, e.g. go to previous/next thread root, toggle collapse/expand of
thread (or double click), toggle mute of thread. some previous shortcuts have
changed, see the help for details.

the message threading are added with an explicit account upgrade step,
automatically started when an account is opened. the upgrade is done in the
background because it will take too long for large mailboxes to block account
operations. the upgrade takes two steps: 1. updating all message records in the
database to add a normalized message-id and thread base subject (with "re:",
"fwd:" and several other schemes stripped). 2. going through all messages in
the database again, reading the "references" and "in-reply-to" headers from
disk, and matching against their parents. this second step is also done at the
end of each import of mbox/maildir mailboxes. new deliveries are matched
immediately against other existing messages, currently no attempt is made to
rematch previously delivered messages (which could be useful for related
messages being delivered out of order).

the threading is not yet exposed over imap.
2023-09-13 15:44:57 +02:00
..
authresults.go add webmail 2023-08-07 21:57:03 +02:00
authresults_test.go add webmail 2023-08-07 21:57:03 +02:00
doc.go mox! 2023-01-30 14:27:06 +01:00
from.go add strict mode when parsing messages, typically enabled for incoming special-use messages like tls/dmarc reports, subjectpass emails 2023-08-15 08:25:56 +02:00
hdrcmtdomain.go add webmail 2023-08-07 21:57:03 +02:00
headerwriter.go mox! 2023-01-30 14:27:06 +01:00
messageid.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
messageid_test.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
parseheaderfields.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
parseheaderfields_test.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
part.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
part_test.go add strict mode when parsing messages, typically enabled for incoming special-use messages like tls/dmarc reports, subjectpass emails 2023-08-15 08:25:56 +02:00
qp.go add webmail 2023-08-07 21:57:03 +02:00
readheaders.go mox! 2023-01-30 14:27:06 +01:00
referencedids.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
referencedids_test.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
threadsubject.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
threadsubject_test.go implement message threading in backend and webmail 2023-09-13 15:44:57 +02:00
time.go tweak time format for added date headers 2023-06-04 21:04:10 +02:00
tlsrecv.go add webmail 2023-08-07 21:57:03 +02:00
todo.go mox! 2023-01-30 14:27:06 +01:00
writer.go improve message parsing: allow bare carriage return (unless in pedantic mode), allow empty header, and no longer treat a message with only headers as a message with only a body 2023-08-11 14:07:49 +02:00
writer_test.go improve message parsing: allow bare carriage return (unless in pedantic mode), allow empty header, and no longer treat a message with only headers as a message with only a body 2023-08-11 14:07:49 +02:00