Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net_imap: Add THREAD=REFERENCES algorithm.
This adds support for the canonical threading algorithm formulated by Jamie Zawinski while at Netscape, formalized in RFC 5256. This is the preferred threading algorithm. Step 5 of the algorithm is skipped in this implementation, since MUAs today do not (and should not) thread messages based on the subject alone, as ORDEREDSUBJECT does. Step 6 of the algorithm is embedded in the parent/child linking function, and thus does not need to be done separately. One liberty taken in this implementation, not specifically discussed in either the RFC or JWZ's writeup of the algorithm, is how to handle dummy messages beneath the root that have multiple children. In particular, step 3 of the algorithm in the RFC says for dummy messages with children, children should be promoted to the current level unless they would become children of the root, unless there is only one child. However, dummy messages can obviously not appear in the final thread results. The sensible thing MUAs seem to do is promote the first (oldest) child to the parent in these cases, and so that is the approach adopted in this implementation. The official algorithm does not explicitly say to do this, but this seems to be the right thing to do.
- Loading branch information