Empty/Broken messages

Hi,
One of our customers has following problem after a database crash, caused by a power outage.

0_1521192619267_Bildschirmfoto 2018-03-16 um 10.29.34.png

The messages are empty, I cannot open the messages, and I cannot delete or move them.
But I can see the subjects in Outlook and via the python interface:

import kopano
server = kopano.Server()
store = server.user("wilfried").store
inbox = store.folder("Inbox")
for item in inbox:
	print(item.received, item.subject)

I tried to the the item.entryid, but I get some strange python messages, so I also tried to delete them with python (by adding the sys utf8 stuff):

import kopano
server = kopano.Server()
store = server.user("wilfried").store
inbox = store.folder("Inbox")
import sys
reload(sys)  
sys.setdefaultencoding('utf8')
for item in inbox.items():
	if 'askari online-shop: so können sie ihr passwort ändern' in item.subject.lower():
		inbox.delete(item)

but then I get the following message back:

>>> for item in inbox.items():
...     if 'askari online-shop: so können sie ihr passwort ändern' in item.subject.lower():
...             inbox.delete(item)
... 
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/lib/python2.7/dist-packages/kopano/folder.py", line 446, in delete
    item_entryids, folder_entryids, perms, props = self._get_entryids(objects)
  File "/usr/lib/python2.7/dist-packages/kopano/folder.py", line 433, in _get_entryids
    item_entryids = [_unhex(item.entryid) for item in items if isinstance(item, _item.Item)]
  File "/usr/lib/python2.7/dist-packages/kopano/item.py", line 234, in entryid
    return _hex(self._get_fast(PR_ENTRYID, must_exist=True))
  File "/usr/lib/python2.7/dist-packages/kopano/compat.py", line 75, in hex
    return s.encode('hex').upper()
AttributeError: 'NoneType' object has no attribute 'encode'

Everything else works fine, all other items (mails, calendar items, contacts, z-push…) works pretty well.

Thank you for your help and tips!

For critical/time sensitive things I would always recommend to rather contact our support directly (assuming you have a aubscription).

Mapi objects consist of many rows of data in the database and it seems you have a partly corrupt database. I would recommend to go back to the last clean mysql dump.

The crash happened on March 1st and everything else works perfectly, therefore a recovery isn’t an option, moreover, another one ones again. So there does not exist any tool to repair a mapi object? Or do delete a broken item? kopano-fsck does not help.

Upgrade to f30b628de8f9d334b014b19d0c33aa9233bc5b78 if you have not yet, maybe that fixes it.