mikehardy / thunderlink

Link to your Thunderbird emails!
Mozilla Public License 2.0
42 stars 14 forks source link

support for resolving RFC 2392 URLs (mid URLs) #46

Closed nbeaver closed 4 years ago

nbeaver commented 5 years ago

Summary

I noticed that Thunderlink provides the option to generate URLs conforming to RFC 2392, which is great. However, while I am able to generate mid: URLs, I am having trouble resolving them, despite Thunderlink URLs with the same message ID resolving without issue.

Steps to reproduce

Here is the script I have used to reproduce on Linux (you can replace the MESSAGEID variable with one that is in your mailbox):

#! /usr/bin/env sh

MESSAGEID=55AA0A5F.4010409@gmail.com
thunderbird -thunderlink "thunderlink://messageid=${MESSAGEID}"
thunderbird -thunderlink "mid:${MESSAGEID}"

The Thunderlink opens just fine, but the mid URL fails with an error that says "Couldn't find an email message for ThunderLink". The same thing happened when I sent myself an email with the Thunderlink and mid URL in the same message and clicked on both of them. (Note that neither of these methods depend on registering the mid protocol. It so happens I do have the mid protocol registered on the Linux side, but that's not necessary to reproduce.)

On Windows I only tried the email I had sent myself:

2019-06-05 09_17_23-Inbox - Mozilla Thunderbird

Again, the Thunderlink worked fine, but when I clicked the mid URL it opened a new composition window to "55AA0A5F.4010409@gmail.com" as if it were a mailto: URL, which is not the desired outcome.

I haven't dug into the code yet, but at a cursory glance I don't see a handler for mid URLs in the openThunderlink function:

https://github.com/mikehardy/thunderlink/blob/e93b879d55672011d9e8002295b78a96d501a964/modules/thunderlinkModule.js#L59

Version information

Both Linux and Windows are running the same version of Thunderlink (1.2.9) and the same version of Thunderbird (60.7.0).

Linux: Thunderbird 60.7.0 (64-bit), Build ID 20190520110519, on Ubuntu 18.04 (Linux 4.15.0-50-generic).

$ apt-cache policy thunderbird
thunderbird:
  Installed: 1:60.7.0+build1-0ubuntu0.18.04.1
  Candidate: 1:60.7.0+build1-0ubuntu0.18.04.1
  Version table:
 *** 1:60.7.0+build1-0ubuntu0.18.04.1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
        100 /var/lib/dpkg/status
     1:52.7.0+build1-0ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 Packages

Windows: Thunderbird 60.7.0 (32-bit).

2019-06-05 09_21_35-About Mozilla Thunderbird

mikehardy commented 5 years ago

Yeah, in my case I transform these on click with this: https://github.com/mikehardy/thunderlink/blob/master/integration/open-message-uri.sh

Have you tried that? For windows I'm not sure, and I suppose it would be better to, you know, actually integrate it in the code instead of externally translating since that won't work on Windows I don't think (although...maybe you could do it with cygwin or something) :-)

I'd be happy to merge a PR if you worked one up