Sorry, forgot to change the To: field :/
Pete.
Begin forwarded message:
From: Pete Long pete@valar.uk.net Subject: Re: EXPUNGED Folder Always Visible Date: 6 June 2024 at 09:43:50 BST To: Robert L Mathews lists@tigertech.com
On 5 Jun 2024, at 19:18, Robert L Mathews via dovecot dovecot@dovecot.org wrote:
On Jun 5, 2024, at 12:21 AM, Pete Long via dovecot dovecot@dovecot.org wrote:
After a restart of Dovecot, I see this in the logs:
Jun 05 08:12:07 imap(pete)<19761><KPYfSB8aj4dWH1ne>: Error: Mailbox Deleted Messages: Lazy-expunge transaction failed: Mailbox Deleted Messages: UID=1 67: lazy_expunge: Couldn't open expunge mailbox: Failed to open mailbox .EXPUNGED: Invalid mailbox name: Begins with hierarchy separator
Hmmm, I'm not sure about that -- in my setup I have something different, with no actual mailbox for it:
namespace { hidden = yes inbox = no list = no location = maildir:~/expunged prefix = .EXPUNGED/ separator = . type = private } plugin { lazy_expunge = .EXPUNGED/ lazy_expunge_only_last_instance = yes ...
Perhaps someone else who has a similar setup to you with it as a mailbox can offer more advice, sorry!
Not to worry Robert, you've given me some useful information.
I have a workaround now which 'works for me' (TM). The gist is to copy an acl file to the .EXPUNGED mailbox when it is created, which is usually when a mail is sent, moved or deleted. I am not using global acls so note the commented line in the next paragraph.
In /etc/dovecot/conf.d/50-expunge.conf:
namespace inbox { mailbox EXPUNGED { autoexpunge = 7days autoexpunge_max_mails = 100000 } }
mail_plugins = $mail_plugins lazy_expunge acl plugin { # Move messages to an .EXPUNGED mailbox lazy_expunge = EXPUNGED
# Define ACL so that user cannot list the .EXPUNGED mailbox #acl = vfile:/etc/dovecot/global-acls/expunged-acl
# Expunged messages most likely don't want to be included in quota: quota_rule = EXPUNGED:ignore }
Once the ~/Maildir/.EXPUNGED directory is created, I copy this 'dovecot-acl' file in to that .EXPUNGED directory:
owner wstipeka
Note that there is no l,r or x. https://doc.dovecot.org/configuration_manual/acl/#acl
The end result is that the .EXPUNGED mailbox contains deleted and moved mail items but the user cannot see this mailbox and cannot delete it anyway.
If necessary I can fire up Mutt and traverse to the relevant users .EXPUNGED folder to rescue deleted items. If they also happen to have FTP and/or SSH access, I can make the dovecot-acl immutable if necessary.
Thanks again Robert for giving me some more options.
All the best,
Pete.