Some years ago it was possible to use the Thunderlink plugin to obtain a “link” to a specific email, and when you clicked that link it would open Thunderbird with a focus on the required email. However, that project died. Fortunately, Camiel Bouchier made the necessary re-writing of the code need to make it work with newer versions of Thunderbird’s API, in what it’s called cb_thunderlink. For the time of writing ( ) it is still maintained, let’s hope it keeps that way.
The (sort of) documentation for the plugin is on this post of Camiel’s website. And to use it in conjunction with Emacs it is also needed an Elisp workaround to tell emacs how to respond when
org-open-at-point is executed on one of
- The installation of the
cb_thunderlinkplugin is straightforward in the Thunderbird Plugin Store.
- The workaround, on the other hand, I got from vxlabs’ website, where he explains how to Link directly to emails from Emacs Orgmode using Thunderbird and Thunderlink. As you may have noticed, the workaround was written for
thunderlink, not for
cb_thunderlink, so I have made some modifications to it. Also, there was a conditional to check if the system was Mac or not, I removed that part too as I do not need it. See the code below:
A link generated with
cb_thunderlink looks something like this:
In the article Link directly to emails from Emacs Orgmode using Thunderbird and Thunderlink they suggest to write in your notes
message instead of
cbthunderlink, this way you can use something else in the future in case
cb_thunderlink also dies as the linking system in your notes will not depend on it (at least completely).
In the configuration of the
cb_thunderlink plugin you can manage the format to copy the email link. In my case I have made one called
emacsOrgLink, which is set to
[[message://$cblink$][$subject$]] to comply with Org-mode link format. Note that the name of the link will be the subject of the email.
The code above will associate the function
org-message-thunderlink-open to the
message key when
org-open-at-point is executed on these links, and then it will replace
cbthunderlink to pass the link to Thunderbird. Of course this part can be avoided by just letting the links in their original format (starting with
cbthunderlink), and the function would be really simple. Once more, I chose
message is built in Emacs. Nevertheless, I do not think if I stop using Thunderbird and go to Mu4e or Gnus the links would work (because of their
messageid being different in Mu4e-Gnus VS
cb_thunderlink). Anyway see this recent post of vxlab which is similar to the one discussed above, but for Mu4e and fastmail. You can decide which format to use.
The last point to highlight is the use of
(kill-new (concat "cbthunderlink://" message-id)). Because of limitations of the Thunderbird API, which dropped support for the
thunderbird -thunderlink <email-link> clickable feature,
cb_thunderlink cannot directly open the emial is some systems (see documentation). In those systems where it cannot simulate the needed behavior and open the specific email directly, instead, it creates a button on the top-right corner (close to the “Display Thunderbird menu”), which once clicked will use the content of the clipboard to open the corresponding email, in case the content of the clipboard is a
cb_thunderlink email link. This line of code copy the email link to the clipboard so we can access the desired email.
Summarizing, once everything is set up. You right-click on the body of the email in Thunderbird, go to the
cb_thunderlink menu entry (usually on the bottom), and copy the formatted link you established (
emacsOrgLink in my case). Next, past it in Emacs. Once you need to use it, just execute
org-open-at-point (C-c C-o), and it will open Thunderbird, but in some cases not yet the specific email. If this functionality is missing, to open the specific email just click on the
cb_thunderlink button on the top-right region. You should see now the email.
This solution is not es elegant as the use of Gnus and Notmuch, but certainly will require much less setup than those two, and time, which I don’t have right now for that. If you have not the time, or would like to continue with the visual interface oriented approach that is Thunderbird in face to Gnus and Notmuch, this is the solution to have links in your notes redirecting to the related email.
Thanks for reading the post! Do not hesitate to write me an email and share your point of view or ask any question (this way we both improve): firstname.lastname@example.org