Mariachi, the not really Siesta bit

the steps

load

Pulls all the messages from the source folder.

Email::Folder buys us some flexibility here - we didn't have to do any special handling for mboxes as opposed to maildirs.

dedupe

Drop things with duplicate message-ids. This is because some mboxes are dirty (and Mail::Thread will choke else)

thread

Call out to Mail::Thread, which implements jwz's message threading algorithm.

sanity

Check every message that we had after discarding is reachable via the thread tree. We do that a few times just to be sure.

order

Sort the threads datewise

lurker output

 Traditional        Lurker
 a                  a--+
 |- b               |  b--+
 |  |- c            e  |  |
 |  `- d               c  |
 `- e                     d
 Date order: a b e c d

strand

Wander the tree setting up the prev and next relations of the messages.

deep threads split up

Folds over-deep thread cascades

 a               *
 `-b             |-a
   `-c           | `-b
     `-d         |   `-c
       `-e       `-d
                   `-e

If we declare point d to be too deep we transform the tree.

generate

Output generation.