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?
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).
I admit, not a "Pro Enterprise Web2.0" solution, but this might work:
The Maildir layout looks like that:
So one could write an
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:
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