I have an email system (using modified round cube) on a web server running CentOS and want to disable deleting of any emails.

I have done this within the round cube software however this will not stop someone accidentally deleting an email from their phone.

would it be possible to make it so all files in the email folder could never be deleted, even from a phone or another email client.


You could use file system attributes on the files to stop the actual files from being deleted but that could cause unpredictable results with your imap/pop3 software.

if you really have to you can stop a file from being deleted even by the root user by setting the immutable attribute.

chattr +i file_name
  • +1 ... just don't run chattr on the emails' parent directory ... – danlefree Oct 14 '10 at 12:14

There are... a number of issues involved in doing this, making it a poor solution. Better would be to configure the mail server to prevent deletion of email altogether, moving to a different mail server if need be.

  • to accomplish this, which mail server would you recommend using on CentOS? – James Oct 14 '10 at 12:21
  • Not a clue. I've never had to do anything like this before. – Ignacio Vazquez-Abrams Oct 14 '10 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy