cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,235
2,423
363
cPanel Access Level
Root Administrator
Hey there! I'm not aware of a way to do this. When a message is deleted, that is a transaction between the client (either a tool like Outlook or Thunderbird, or Webmail) and the IMAP or POP mailserver. There isn't any connection to cPanel or Exim for mail to be processed at that point, so there isn't a way to add a hook to the deletion process.

Are you looking to just retain a copy of every email on the server? If you can let me know more details about what you're trying to do, I may be able to offer an alternative solution.
 

benpollack13

Registered
Feb 20, 2023
2
0
1
United Kingdom
cPanel Access Level
Website Owner
I've had a case where an employee intentionally deleted sensitive information from his mailbox. I am looking to either disable deleting emails or move deleted ones to a different mailbox, the later being the better one
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,235
2,423
363
cPanel Access Level
Root Administrator
Thanks for the additional details - I understand. I don't have anything to offer for this situation specifically.

It might be best to set up something before the email is deleted, as you could have a filter that delivers all incoming mail to another mailbox as well as the intended recipient.