I am creating a small mail/message sending database schema. It is not actuall mail system, but sort of a messaging portal withing an organization, with the following use cases:
- employees can brodcast messages to all employees
- employees can send messages to eachother
- employees can reply to the recived messages
- employees can view the mails which he/she has replied to by seeing a replied at "timestamp" column in the inbox (i.e. there has to be a 'repliedat' column in the inbox which should show the timestamp when this mail was replied, it should be empty if it has not)
- When he opens a particular message he sees a threaded view of the messages, latest being on the top.
My Question How do I track if a particular message is a reply to any message, in emails, i believe it is embedded in the header. Do I keep a 'repliedto' id field which points to another message of which it is the reply?
How do I create threads, or chains?