Thunderbird Toasts is a simple framework that allows Thunderbird to send Windows 10 toasts as notifications instead of its custom popup notifications that are not native. It works on Thunderbird 78+ as of January 2021 and can be thought of as a replacement for now defunct GNotifier.
The intent is for this to become flagship, showcase product of pure C programming and interfacing with the Microsoft Windows operating system.
An installation package is available in the releases section of this repository.
To begin, download the latest available release. It comes in the form of an executable file, usually called setup_thunderbird_toasts.exe.
Before starting the installation, make sure that you saved all your work in Thunderbird, as the program will be reloaded so that the new add-on gets loaded in the program. Then, open the downloaded file and once it is done, a notification should pop-up and Thunderbird will open back up.
Now, you have to open the Add-ons Manager (Tools - Add-ons) and enable the extension in there, by toggling the switch near its name. Then, click "Enable" in the confirmation dialog.
To configure the add-on, click the settings icon and choose Options.
As you can see, the installation process is fully automated and self contained. The files are installed in your profile folder, in the following directory:
C:\Users\Valentin\AppData\Roaming\ThunderbirdToasts
Additionally, the extension is naturally placed in your Thunderbird profile directory (Help - Troubleshooting Information - Open Profile).
The following registry keys are created by the installer:
HKEY_CURRENT_USER\SOFTWARE\Classes\thunderbirdtoasts
- we register a custom protocol so we can handle activation from toasts that we displayHKEY_CURRENT_USER\SOFTWARE\Mozilla\NativeMessagingHosts\ThunderbirdToasts
- we register the native component of the solution with Thunderbird so that the add-on can make use of itWhen you open the program for the first time, a Windows Firewall warning like the following may pop up. Please allow communications on all networks (the components internally communicate over local network sockets).
The options page presents a host of options that can help you customize the behavior of the add-on.
Text fields on the toast notifications that you can customize provide a series of variables that will be replaced with the particular value from the mail message for which the toast is displayed. The current list of variables is:
More options may be provided in the future, and they will surely be mentioned here. Please suggest new, useful variables or functions here.
Next. a brief explanation for each of the options the add-on supports is presented below. The default values are displayed besides each of the settings, so that it is easy to revert to factory configs. All the available tweaks are automatically saved.
Get-StartApps
.The product is made out of two main components:
A custom URI scheme (protocol handler), thunderbirdtoasts://
is installed on the system, allowing clicked toasts to open back in the Thunderbird application. The format of a request to this system is the following:
thunderbirdtoasts://111111111111/3682732184834846b73483784==
Where:
111111111111
is the epoch of the message (date and time of the message)3682732184834846b73483784==
is the base64 encoded message-idInternally, the protocol handler instance and the background process instance communicate via a socket that runs on the fixed TCP port 46578
(chosen randomly, fixed). Supported commands are similar to the URI schema, thus, you can make similar requests to the one above by using HTTP and standard client like:
curl 127.0.0.1:46578/111111111111/3682732184834846b73483784==
This will use the GET request of the HTTP protocol. You can send a random POST request to trigger a random notification to pop up (for testing purposes), while a DELETE request will uninstall the add-on.
I will publish more in-depth details soon, probably as a series of articles on my web site, for when time will allow.
This is a very good teaching example in my opinion, as it helps broaden your knowledge in a few diverse areas:
ALL sources are available in this repository.
To put together the add-on, simply zip the contents of its "src" folder, change the extension to xpi and load in Thunderbird.
For details about the C native client, check the README in its folder: src\native-app.
This product uses code from the following third party repositories:
cb_thunderlink - Copyright Camiel Bouchier (many thanks for his module). License: Original work is all rights reserved, however, I have obtained permission from the author of the project to use his work in my own project subject to the following terms and conditions:
Camiel Bouchier (camiel@bouchier.be) grants Valentin Radu (valentin.radu@valinet.ro) a non-exclusive license to use the source code (i) copyrighted by Camiel Bouchier AND (ii) published on "https://github.com/CamielBouchier/cb_thunderlink" for whatever purpose provided that (i) the copyright notice is maintained AND (ii) such purpose is not having substantially the same functionality as cb_thunderlink such as published on "https://github.com/CamielBouchier/cb_thunderlink". THE SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL Camiel Bouchier BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
EditEmailSubject-MX - Copyright Team@EditEmailSubject-MX. License: GNU General Public License v3.0
Windows classic samples - Copyright Microsoft Corporation. License: MIT
Taking into consideration the licenses of the individual components, the combined work of this project is released under GNU General Public License v3.0 or newer.
Additionally, I license all my original work that's separate from the third party bits used in this project under MIT license.