Search code examples
androidemailmetadataimapthunderbird

Storing additional data to mail in IMAP


Introduction

I have a xy-problem

x: High level goal

I have dream: I want to store additional data to mails which are in IMAP. I the long run I want to be able to access this data via thunderbird and k9 (android app (mail use agent)).

Use cases:

  • I want to store a note in html format for this mail.
  • Upload a PDF file for this mail.
  • I want to store a re-submission date on the mail. Like google inbox snooze feature: Move the mail to a "do later" folder until the date is reached. (Evaluating this date and moving the mail to inbox again is not part of this question)

But I have no clue how to store additional data

y: My current thoughts about solving it

I need a way to identify a message in IMAP. I think the message id (without folder name) should work. I know that message IDs can have duplicates, but I see no other way. Please leave a comment, if you have a better idea.

Now I need a way to store this mapping somewhere:

`user@imapserver:message-id` --> `additional-data`

Question

How to store this mapping, so that thunderbird and k9 could access it?

Of course I know that thunderbird and k9 can't access this data today. How to patch them is a different question.

Background

I like free software and I like free communication. Up to now I use WhatsApp, Threema and other tools. But in the long run I want a free (like in software) solution. Email is wide spread, and I think it makes more sense to improve email than to create something new.


Solution

  • You could store annotations in a parallel mailbox as MIME messages using APPEND. You'd have to figure out a way to map annotations from one message to another.

    So you can find the related message easily, you'll want it easy to search for. You could do something like using the message-id of the source message as the subject of the annotation message, or a transformation of the message id as the message id of the destination message.