Look at 'references' headers (more precise than threading according to subject in the case where in-reply-to can not be found). Once references is being used, how to represent holes in the discussion (missing mails) in the JSON (should not fake in-reply-to directly to parent of parent)?
I've already got a partical implementation of this. Finish it.
Cost: $140.
⇒ Cost range: $140