TN
2015-Feb-10 15:36 UTC
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
Alexander Moisseev
2015-Feb-10 18:46 UTC
How to Delete an user and Purge attachements with a common directory mail_attachment_dir with SIS for all users.
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 at dovecot.org/msg41683.html -- Alexander
Alexander Moisseev
2015-Feb-12 11:44 UTC
How to Delete an user and Purge attachements with a common directory mail_attachment_dir with SIS for all users.
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
Reasonably Related Threads
- How to Delete an user and Purge attachements with a common directory mail_attachment_dir with SIS for all users.
- Best way to delete an user mailbox with mdbox format and all attachments detach/dedup ?
- [bug][Pigeonhole 0.4.10] Missing msgid
- [bug][Pigeonhole 0.4.10] Missing msgid
- SIS: dovecot creates duplicated attachments (sometimes)