Hello, I'm trying to understand how to clean up old dovecot.index.pvt.log files, which are used for per user private \Seen flags. Running "doveadm purge" does not seem to remove them.
I have the following public namespace configured:
namespace public { type = public separator = / prefix = Public/ inbox = no hidden = no mail_driver = mdbox mail_path = /data/mailstore/%{user|domain|lower}/mail_public/mdbox mail_index_private_path = ~/mdbox/Public.index.pvt # Enable user private \Seen flags list = yes subscriptions = no
Allow users in the 'admin' group to have complete control over the namespace
acl group=admin { rights = lrwstipekxa } }
The problem is - if the admin deletes a public folder, the old dovecot.index.pvt.log files forever remain in all of the users' home mailbox directories, like tombstones.
I see two ways around it:
- Attempt to store private index files in the original folder's mail path, so when the folder is deleted, all files underneath it are also deleted automatically:
mail_path = %{mail_directory}/Public.index.pvt/%{user|domain|lower}
However there appears to be no %{mail_directory} variable which would expand to mdbox/mailboxes/<folder_name>/dbox-Mails/ and even if there was one, with public folders, for every user subscribed to this folder, there would be a user-specific directory just for the private index file. This may not scale well with thousands of users.
- Run a cron script to list all public folders and then compare ~/mdbox/Public.index.pvt directory of each user for stale private index files which refer to non-existent folders. This can probably be done efficiently with commands like find, awk and sed, but it feels a bit cumbersome and arcane.
Can anyone suggest any other or better alternatives to solve this issue?
Thanks.