使用模块或插件将phpfox线程邮件的所有消息备份到其他表

I am trying to create a module which will backup all the messages sent in phpfox mail to one more table "phpfox_backup" i.e. when user send a message it will be inserted to phpfox_mail_thread_text at the same time it should be inserted to phpfox_backup. i have tried to find the variable through which i can get the messages but failed.is there any way i can get the messages and insert it to the phpfox_backup table?