How to Delete an user and Purge attachements with a common directory mail_attachment_dir with SIS for all users.
Hello everybody,
What is the best way to delete an user mailbox (ex:
/var/mail/johndoe ) when all attachments (for all users) are in a common directory with SIS deduplication (ex: mail_attachment_dir = /var/mail/attachments ) ?
Trying to delete user mailbox directory (rm) and do the command : doveadm -v purge -u johndoe leave all johndoe's attachments orphelin.
Best regards, TN
10.02.2015 18:36, TN пишет:
What is the best way to delete an user mailbox (ex: /var/mail/johndoe ) when all attachments (for all users) are in a common directory with SIS deduplication (ex: mail_attachment_dir = /var/mail/attachments ) ?
Trying to delete user mailbox directory (rm) and do the command : doveadm -v purge -u johndoe leave all johndoe's attachments orphelin.
You should always expunge mailbox *before* deleting it, if you are using SIS.
# doveadm expunge -d -u johndoe mailbox '*' all # rm -rf /var/mail/johndoe
https://www.mail-archive.com/dovecot@dovecot.org/msg41683.html
-- Alexander
On 12.02.2015 12:00, TN wrote:
Hello Alexander, Thank you for your answer, it is very helpfull for me.
Just a little addon with your process to complet the deletion an user :
# doveadm expunge -d -u johndoe mailbox '*' all # doveadm -v purge -u johndoe (this command force attachment deletion immediatly ) # rm -rf /var/mail/johndoe
Thank you
PS: Sorry to not reply to the dovecot list because i setup a digest for all answers.
Hi,
Many thanks for your reply. It's a *very important* addition actually.
There is lack of documentation on SIS. So I have done some experimenting and found out that the command # doveadm purge -u johndoe *is mandatory*. Without this step attachements will stay in mail_attachment_dir forever.
Man doveadm-purge(1) states "doveadm-purge - Remove messages with refcount=0 from mdbox files", but actually it also removes attachments from mail_attachment_dir.
-- Alexander
participants (2)
-
Alexander Moisseev
-
TN