Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to configure a mail server to prevent deletion of email

preferably one supporting maildir and that works flawlessly with roundcube

which mail server would you recommend and how easy would it be to configure this?

share|improve this question
Why do you want to do this? Are there legal requirements or standards compliance issues here? May make a big difference to the answers you'll get. – dunxd Oct 14 '10 at 15:09
legally have to keep certain emails for 6 years, can be asked for proof we sent the email anything up to 6 years after it was sent. If it was accidentally deleted there would be a huge fine to pay. – James Oct 15 '10 at 10:16

Ah.. Exchange?

Seriously, this is higher end business stuff and that is normally where open source just simply fails. Fully integrated internal retention policies as well as legally safe auditing of incoming and outgoing emails (because easily to fake logs are not going to stand in court) are one of the reasons Exchange is (still) in businesses (and growing).

I am not aware of any open sourceo or otherwise slution that does what you ask for (specifically with maildir).

share|improve this answer

I admit, not a "Pro Enterprise Web2.0" solution, but this might work:

The Maildir layout looks like that:

                new/ # Unread mails
                cur/ # Read mails

So one could write an inotifywait script waiting for new files in /path/to/maildir/cur and remove the write permission, make the file immutable, whatever.

share|improve this answer

maybe you can use the concept of "shared-folder" in IMAP (cyruss has it and probably other imap service implementations as well). make the mailbox owner some hidden user and "share it" to the real owner. see cyrus shared folders and acls in the documentation. it may work flawlessly to some extent with roundcube and other clients as long as you only use imap. it would be interesting to implement this.

as a note (donts) , ugly filesystem hacks will make imap throw errors to the client, not being aware of external setups:

chattr +t Maildir/{cur,new,tmp}

this will put the mail folders in append-only mode and works only if the MDA moves the messages to the folder and isn't doing open/write directly in maildir (probably most MDAs don't do the second but the first).

ugly hack number two, a MDA wrapper to chattr +i the message after it is written in maildir. no guarantee that the client won't delete the message between MDA write and chattr

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.