Support for the "message" URI scheme

I’d love to see support for the message protocol handler support in KMail, as in: It should be able to open message links like it’s able to react to mailto.

Why?

When I drag an email from Apple Mail into Todoist on my iPhone, it’s linked using said protocol using its identifier (Message-ID, I guess?). As a result, I’m having a link like:

message:%3CAM9PR05MB8548CEEC16A9602E6BB439BB873D2@AM9PR05MB8548.eurprd05.prod.outlook.com%3E

And when I click it on iOS, the mail application automatically opens and points me to that message, no matter in which folder it is stored.

It’d be absolutely awesome if KMail could support this as well!

Standards

Unfortunately, I haven’t found a RFC or something similar (yet?) that describes the intrinsic of this link format. [RFC2392] (1998) seems to “register” mid as the recommended URI scheme, but that differs from Apple’s implementation, so it’s likely not standardised.

This sounds like an Apple specific URI scheme and likely contains an internal ID of the device’s PIM service (message IDs are not necessarily unique)

When you use KDE PIM (e.g. KMail) this is essentially also implemented via the akonadi URI scheme.

I.e. when you drag an email out of KMail one of the “formats” this data is offered in to the drop target is an URL (might be the only “format”, not sure).

What the target does with the URL is up to that application.

For example if you drag into Konsole it will just display the URL.
If you drag into KWrite it will consider the URL like a file and load its content (via kio_akonadi).

I have just tried “opening” such an URL using xdg-open and it created a KMail message view with that email.
It did not change the folder though.

[RFC2392] (1998) seems to “register” mid as the recommended URI scheme

From a cursory glance that seems to be for URIs within single emails, e.g. when an HTML email needs to refer to other content inside the same email like icons or an attachment.