i have a quick question about Dovecot ACLs,

What i intend to do is prevent users from deleting emails,

I was able to change the permissions of the 'Trash' folder so users cannot purge deleted emails so all is good.

But, users on outlook can do a shift delete bypassing the the 'Trash' mailbox. Using ACL i can prevent delete all together which is not an option. i want them to be able to delete (move to trash) but not shift delete.

Any ideas ?

Thanks a lot


  • Your options depend a bit on why you need to prevent users from deleting email messages in the first place. For auditing/compliance purposes you typically configure an archive with a permanent record with copies of each SMTP message that is sent/received at the Postfix/Exim level, where messages will persist regardless of users modifying/deleting them in their personal mailbox... For multiple users getting access to the same maildir: wiki2.dovecot.org/SharedMailboxes/Public#Read-only_mailboxes might be an approach – HBruijn Dec 13 '16 at 16:05
  • Thanks a lot for your help, you exactly described my need. its for compliance purposes and i need to keep copy of all emails. an archive seems logical ill do some research to see how feasible it is. thanks again – Ahmad Dec 13 '16 at 19:29

Pretty much all mail clients will support similar features, and you will not be able to prevent deletion of messages while allowing moving messages to the trash folder. Originally, IMAP did not support a "move" operation at all, moving messages meant copying it to the target mailbox and finally deleting it in the source location.

Consider other solutions as well (depending on the actual requirement behind "not allowing shift-delete"):

  • Dovecot does not immediately purge messages (at least in the mdbox format), so you can recover them after deletion
  • there is the lazy expunge plugin
  • properly archiving messages in another system before storing them in Dovecot might be more reasonable if you have to keep the mails for legal reasons
| improve this answer | |
  • Thanks a lot for this quick answer, do you think switching from maildir to mdbox is an advantage for this issue? Also what kind of archiving are you thinking of ? some sort of mail copy using postfix ? i will look into your proposed solutions, many thanks. – Ahmad Dec 13 '16 at 15:55
  • The mdbox format is generally superior compared to maildir (compression, performance) but for the fact you cannot look into the .eml files directly any more (but doveadm is a very good administration utility). Whether switching will solve this specific issue depends on the problem you're actually trying to solve: preventing deletion of messages does not seem to be the actual requirement, but a possible solution to the real issue you want to solve. – Jens Erat Dec 13 '16 at 16:37
  • the more i think about it the more it seems logical to go in the archiving direction. many thanks for your help – Ahmad Dec 13 '16 at 19:28
  • Regarding archiving: yes, I'd create copies within Postfix in this case. Also consider outgoing messages if required! – Jens Erat Dec 13 '16 at 22:35

The typical solution when you have regulatory and/or compliance requirements to store (all) email messages is quite different from your approach. You don't try to make email read-only1 to the user/recipient, but you leave your users in control of their own mailbox and simply keep a seperate archive for compliance/e-discovery.

See for instance the postfix allways_bcc feature.

1 ) Dovecot offers some support for that, in combination with file-system permisisons/ownership at the file system level, see http://wiki2.dovecot.org/SharedMailboxes/Public#Read-only_mailboxes

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.