[Kde-pim] retrieving a resource from an akonadi:/ url

Jos van den Oever jos at vandenoever.info
Mon Jul 4 17:02:01 BST 2016


On Monday 04 July 2016 17:45:57 Kevin Krammer wrote:
> On Sunday, 2016-07-03, 20:07:40, Jos van den Oever wrote:
> > On Sunday 03 July 2016 13:53:48 Kevin Krammer wrote:
> > > > I've written function createMailDirPath (see attachment) to obtain the
> > > > file
> > > > path from the concatenated Akonadi::Item::remoteId() values.
> > > > This works great. I'm doing this instead of using the raw data from
> > > > akonadi
> > > > because I noticed that the bytearray returned from akonadi is not
> > > > exactly
> > > > the same as the contents of the file in the maildir.
> > > 
> > > This is actually interesting, fetching the full payload should just
> > > fetch
> > > the mail.
> > > Even if the parsing and serialization that happens in the resource
> > > somehow
> > > modifies the content, it should always be the same modification, i.e.
> > > fetching the same mail should always result in the same byte array.
> > > 
> > > Are those mails stored through Akonadi or is a different process
> > > creating
> > > the file inside the maildir tree?
> > 
> > The mail is retrieved from a pop3 account by fetchmail [1]. KMail/Akonadi
> > knows about the maildir directory via the maildir resource. So the mail is
> > not stored through Akonadi.
> 
> Ah.
> Then the change you've been seeing is most likely caused by KMime's parsing
> or reassembling.
> 
> Hmm, any specific reason you need the original byte sequence?

Yes, I want to link to emails from private documents. Emails may move around 
so I'd like a stable identifier. Using a hash code like sha1 or sha256 to 
identify the file seems like a good solution. Emails should not change so the 
hash should not change either and would be a good simple long term identfier 
for email. Or at least it would be a good additional identifier next to 
Message-Id that helps to keep the links alive.

Cheers,
Jos


_______________________________________________
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