Hi everybody,

We have to delete all the messages in the inbox of a particular user. For this we use the Python script below which we start daily using cron:
------------------------
#!/usr/bin/env python

import zarafa
from datetime import datetime, timedelta
from MAPI.Tags import *
import time
import sys


def opt_args():
parser = zarafa.parser('skpcufm')
parser.add_option('-t', '--test', dest='verbose', action='store_true', help='enable verbose mode')
return parser.parse_args()

def main():

for folder in zarafa.Server().user('backup').store.folders(parse =True):
if folder.name == 'Inbox':
for item in folder.items():
folder.delete([item])

if __name__ == '__main__':
main()
-----------------------------------------

Most of the times it works without any problems but every now and then some (not all) messages are not deleted and below is the error message we get:

---------------------------------------------
Traceback (most recent call last):
File "/root/bin/backup-check/clear_backup_mail.py", line 23, in <module>
main()
File "/root/bin/backup-check/clear_backup_mail.py", line 20, in main
folder.delete([item])
File "/usr/lib64/python2.6/site-packages/zarafa/__init__.py", line 1313, in delete
self.mapiobj.DeleteMessages(item_entryids, 0, None, DELETE_HARD_DELETE)
File "/usr/lib64/python2.6/site-packages/MAPICore.py", line 510, in DeleteMessages
def DeleteMessages(self, *args): return _MAPICore.IMAPIFolder_DeleteMessages(self, *args)
MAPI.Struct.MAPIErrorDiskError: MAPI error 80040116
----------------------------------------------

We tried to Google a solution, but no luck so far. Is there anybody here that can point us in the right direction?

Regards,
Cor van den Berghe