Deleting attachments from deleted accounts

  • What tool is used to delete attachments from /var/lib once an account has been removed in LDAP?

    I just removed 5 accounts. I then ran the script, but the attachments for those users still exist.

    What else needs to be done?

  • Interestingly enough, I ran the command again and it found 20-30 unreferenced attachments. Then I ran it again, and it found some more. Same thing a third time. So … what gives? How do I just run this once and get ALL the unreferenced attachments deleted at one time, and is there any other way to close out an e-mail account fully?

  • I also ran db-remove-orphaned-attachments command. It gave this output:

    Finding all orphaned attachments…
    Processing 4240 orphaned attachments
    Cleaning singleinstances…
    Cleaning lob…
    Flush database changes to disk…

    However, a GREP on the directory STILL shows attachments in the name of accounts which have been deleted. And the disk size didn’t change based on a “du” check of the folder.

  • Kopano

    If you delete a user, the store belonging to.the user becomes orphaned. You have to delete the orphan with kopano-cli/kopano-admin.

  • Yes, I know. That’s already been done. I’m wanting to know about the attachments which apparently aren’t deleted even after the store is deleted. Any thoughts on those?

  • Kopano

    Then, there must still be a reference to it.

  • We run a script which deletes the userid from LDAP and then searches for the store and removes it. That’s done all at one time. Where could there possibly still be a reference to a non-existent store? I’m just trying to clean up GB of disk space.

  • Kopano

    When you are using LMTP then attachments in mails delivered to multiple recipients are just stored once on disk, but referenced from multiple mailboxes.

    Its not a reference to a store, but a reference to the attachment i am talking about.

  • Will have to do more digging on some of the attachments referenced and see. Thanks.

Log in to reply