Hi @Tushar Lakhotia ,
I can think of 2 ways of doing this:
I hope the mail subject lines remain common in replies and no one is updating the subject of mail while replying to it. You can use subject of mail as a key to group emails in the database. Strip prefixes like RE or FW to normalize the subject for matching and updating the body of mail.
If subject is not the only thing that can be used to link, then it will be good to combine multiple fields like sender mail address, recipient mail address, and subject.
You can try the above 2 options to link and save your mail in the database.