1

Users in my org use Outlook 2010 e-mail client with pop3 access to ZCS/OSE. These clients are using default "delete messages from server after 14 days" setting All message boxes are set up as follows:

  1. Store not more 450 Mb per mailbox
  2. TTL for regular message is 60 days and for trash/spam is 30 days.

Purging activity works as supposed to be. But... Manual reindexing a mailbox from admin GUI shows that there 5000+ (more than five thousands) messages to index, but total number of items (mail+calendar+...) as about 300 (three hundreds or less a bit).

More, the examination of /opt/zimbra/storage subdirs shos that some .msg files stored there are from 2009 year!

And some mailboxes looks full, even if there aren't any messages in any mailbox folders. Just because account's subdirectory is filled with old, deleted for long time ago messages.

Can anybody explain, if theres any possibility to really purge obsoleted message files? FINDing them with mtime parameter and deleting does not looks very good idea. I did that, unfortunately. But zimbra stores something in its LDAP server and forcibly "killed" messages are still visible, even if they could not be opened because of "BLOB missing" error.

Is there any way to sanitize ZCS' LDAP directory?

AD7six
  • 2,920
  • 2
  • 21
  • 23
Troublemaker-DV
  • 174
  • 3
  • 12
  • Convenient mini-script to check and reindex: $ mbox=USERNAME;aa=\`zmprov gmi $mbox|grep mailbox|sed -e "s/mailboxId\:\ //"`; zmblobchk -m $aa --export-dir /tmp/zmblb/ --missing-blob-delete-item start; zmprov rim $mbox start; zmprov rim $mbox status – Troublemaker-DV Jun 01 '15 at 01:42
  • Accepting an answer marks the question solved - please don't put "solved" in the question title, use the site as intended. – AD7six Jun 03 '15 at 05:22
  • @AD7six is there any easy way to say to one who looks for similar answer, that the question is solved, not "tumbleweed"? I meant "say it in fastest way". As to me, I hate to browse 100s of topics without knowing if any of these contains the answer I need. – Troublemaker-DV Jun 03 '15 at 05:25
  • 2
    Not sure what you mean. Why would you want to search for accepted-answer questions, rather than ? Unanswered questions are shown on [/unanswered](http://serverfault.com/unanswered), the UI indicates how many answers a question has and [which questions have accepted answers](http://i.stack.imgur.com/o2Eeq.png). – AD7six Jun 03 '15 at 08:52
  • It seems that I looked in wrong direction... It is known error which leads for abandoned files, I think. [Article in Zimbra wiki](https://wiki.zimbra.com/wiki/DB_not_releasing_disk_space_after_deleting_data) – Troublemaker-DV Apr 25 '18 at 00:48

1 Answers1

1

Zimbra doesn't store message metadata on LDAP. Instead zimbra use MySQL to store it. Snippet from Zimbra wiki: Account mailbox database structure

Zimbra uses mysql databases to store mail header information (To, From, Subject, Date, Read/Unread Status, Flags, Tags), contacts, calendar items, and tasks. Zimbra automatically assigns a zimbra account to a mailbox group when the account is created. The mailbox group corresponds to a database located in /opt/zimbra/db/data such as mboxgroup1, mboxgroup2, ...etc. There are a maximum of 100 mailbox groups per mailbox server.

The first task here is fix inconsistency between Zimbra blob and MySQL metadata. You can use zimbra helper called zmblobchk. This command checks the consistency of the Zimbra blob store (/opt/zimbra/store). This command checks and records notes of files without matching database metadata. It also checks to make sure that size information is correct for the files.

The second task is find out why the message still present if the outlook has tell zimbra to delete it. You can try to check zimbra logs, perhaps some Zimbra worker has an error so the automatic deletion process failed.


Convenient mini-script to check and reindex, credit to OP

mbox=USERNAME;aa=`zmprov gmi $mbox|grep mailbox|sed -e "s/mailboxId\:\ //"`; zmblobchk -m $aa --export-dir /tmp/zmblb/ --missing-blob-delete-item start; zmprov rim $mbox start; zmprov rim $mbox status
masegaloeh
  • 18,236
  • 10
  • 57
  • 106