[Kde-pim] fixing mbox - general Akonadi problem ?

Martin Koller kollix at aon.at
Tue Feb 11 18:15:44 GMT 2014


On Tuesday 11 February 2014 18:34:22 Kevin Krammer wrote:
> On Tuesday, 2014-02-11, 18:16:53, Martin Koller wrote:
> > Hi all,
> > 
> > I'm digging into the problems I have with the mbox resource and I hit
> > something which might be a general Akonadi problem - or I just don't know
> > how to:
> > 
> > The mbox resource sets a remoteId for each mail which is of the format
> > CollectionId]::[RemoteCollectionId]::[Offset]
> > 
> > Offset is the starting byte position inside the mbox file.
> > 
> > When the resource needs to remove a mail permamently from the file, it needs
> > to rewrite the purged file to disc - which leads to the problem that ALL
> > remoteIds below the removed mail are getting invalid!
> > 
> > AFAIK Akonadi works asynchronously so added mails to the mbox (from an
> > external prog) and filtering the mail (moving them to some other folder)
> > leads to the problem that MboxResource::itemRemoved() is called with a
> > remoteId which points to some illegal position in the mbox file. (mbox
> > throws some error, but then some mails stay in the mbox file whereby they
> > should be gone leading to duplicate mails on the next load of the file)
> > 
> > How can this be solved ?
> > How can I globally tell Akonadi when one remoteId changes, some others need
> > to change, too - in a way so that I can be sure that no other Akonadi
> > client is already or still using the now obsolete remoteIds ?
> 
> You need to modify the items. Basically fetch basic items from Akonadi and 
> modify those which change.

I tried that - didn't work (but it's easy possible that I made something wrong).
So i thought that the problem is the async nature of
akonadi. I thought the flow is as follows. Please correct me if I'm wrong:

- external prog fills mbox
- mbox resource reads new mails and sends new remoteIds to akonadi
- filter agent gets these and filters (tells mbox resource to remove the remoteIds)
but when the first to-delete remoteId is received in mbox, I already need to modify
the others, but the filter agent already got also the other ones, so it will still
send me the old-invalid remoteIds

> I have a bit of complicated code for that in the mixed maildir resource 
> (complicated because of the abstraction through FileStore).

will have a look.

-- 
Best regards/Schöne Grüße

Martin
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

Geschenkideen, Accessoires, Seifen, Kulinarisches: www.bibibest.at
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list