Kopano Attachment Disk Store has double size then Mailbox

Hey *,

i use Kopano Community in Version 8.6.80 on Debian 9.

I have 3 Mailboxes. 2 for testing (they are empty) and on is my Teammailbox for an migration Test.

Thats why i imported the big Teammailbox 1:1 via Outlook IMAP to Kompano Imap-Mailbox.

Everything works fine.

But now i see a Problem.
The Mailbox got an Size of 40 GB after Migrating. That is what Outlook but also Kopano Deskapp and Webapp says. (Webapp > Mailbox > klick Right > Properties > Size = 40,8 GB)

But i was wondering about a nearly full HDD.
So i logged in via ssh and did “du -sh /var/lib/kopano/attachments”.
The command said 79 GB.

After that i did Webapp > Mailbox > click Right > Properties > Folder Size. The result was:
Size (without subfolders): 40.8 GB
Total size (including subfolders): 81,6GB

Could anyone explain my whats the difference between Size and Total size.

In Addition: When i Export the hole Mailbox to an pst the size is about 40 GB.

thx

  1. have you deleted orphaned stores of deletes user?
kopano-admin --list-orphans
kopano-admin --remove-store GUID
  1. have you items in the soft-delete cache? I think it defaults to 30 days!
nano /etc/kopano/server.cfg ==> search for softdelete_lifetime

kopano-admin --purge-softdelete days
==> Starts a softdelete purge on the server, removing all soft-deleted items which have been deleted days days ago, or earlier
  1. if your attachment storage is still this big, make a backup and then try this script:
https://stash.kopano.io/projects/KC/repos/kopanocore/browse/installer/linux/db-remove-orphaned-attachments?at=6f9c12f3b20d7a197dd41702a5ca2143102986fd
run with per and server.cfg as parameter - will remove obsolete attachments!

Hi @doublex ,

@doublex said in Kopano Attachment Disk Store has double size then Mailbox:

Could anyone explain my whats the difference between Size and Total size.

what you describe is expected and comes from enabling imap on the store. When imap (or pop3) are enabled the server will additionally store the original rfc822 message for performance reasons (so it does not have to be regerated by the server when a client requests it).

This is also the main reason why imap is disabled by default for all user.

@Gerald: Thanks. But this is definitly not the Problem. I did this before. I dont have any other users. And i don´t have any deleted Mails.

@fbartels: Thanks. I think that was my Problem. But please can you tell my how to resolve the Problem. I needed the IMAP Feature für Migrating the Mail. It doesnt work with the PST_Migration-Tool.
Now i disabled the Featrue for this user but the size does not Change.

@fbartels

oops… I will have the same issue as I did use IMAP before I started being able to share public folders and swapped mobile email client and the storage of my inbox will now be massive…

So if there is any way to remove the IMAP data not required anymore I would greatly appreciate it too…

ok. i told that it is only one Mailbox. What i do now is:

  1. Add a new Mailbox without IMAP feature
  2. Move all Folders and Mail from Mailbox A to Mailbox B
  3. Remove all Restoreable Items in Mailbox A

The hole process is needed some Hours. I tested it positiv in 1 Folder.
I will post the result after finishing.

@doublex
How did you do 2.?

@mcostan
2.1 open Mailbox A (old) via Webapp
2.2 give User auf Mailbox B (new) full Access
2.3 open Mailbox B (new) via Webapp
2.4 open Shared Mails (Mailbox A)
2.5 Move the Folders from Mailbox A to Mailbox B

  1. Click Right on EVERY Folder of Mailbox A and open Restore items > Delete all items

@doublex

Thanks. That makes sense.

In my case I don’t think that would be viable… Too many folders.

It would be great if there was a script to do this programmatically from the back end, but I am not aware of any.

Technically is should be enough to clean the PR_EC_IMAP_* attributes from all messages in the store, but as far as I know no ready to use script exists for this.

Please contact our sales team if you want to sponsor such a script.

Thanks @fbartels

I’ll see if I get the chance of going through the database in the spare time and see if I can write something. If so I’ll post it.

@mcostan said in Kopano Attachment Disk Store has double size then Mailbox:

going through the database

Just to have it said: deleting or modifying stuff directly in the database is usually a bad idea. You should rather use python-kopano to perform this deletion.

i finished now with the complex Manual way. The size is reduced from 79GB to 39GB. Its realy the half. Iam happy now.

Can anyone explain the @fbartels -way with “PR_EC_IMAP_* attributes” or the @mcostan -way with “python-kopano” in Detail?

Thanks