Running support: tickets, threading & replies — New ticket, or a reply to an old one?
A reply address naming a record in that mailbox's own table appends to it. One naming a record somewhere else is treated as unthreaded and starts a fresh ticket instead — a wrong thread is worse than a new one. Mail matching nothing at all becomes a new record exactly as it always did.
Either way the body is cleaned first: quoted chains, On … wrote: trails and signature blocks are stripped, so the thread holds what somebody actually said rather than the archaeology underneath it. Attachments arrive as real files on the message, stored exactly like an upload.