Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Configure How Thunderbird Opens A Web Browser

I serve multiple clients, and to make life simple, I set up a different browser profile for each client. This saves me a lot of time/effort with logging into web accounts, and resolves issues that arise from multiple clients having tools like Passbolt, where the browser plugin can only be configured against one server. I do the same thing with Thunderbird, having a profile for each client. Unfortunately, when clicking a link in an email from within Thunderbird, it will default to opening your default browser. This tutorial will show you how to configure Thunderbird to open a browser exactly how you want it to open (e.g. with a custom profile).

Steps

1. Create Browser Script

First, we need to create a little executable command/script, that when called, will open our browser of choice with the settings we desire.

touch $HOME/.local/bin/my-script-name \
  && chmod +x $HOME/.local/bin/my-script-name \
  && editor  HOME/.local/bin/my-script-name

Since I use firefox, my script is as follows (tweak yours as appropraite, e.g. you may be using chromium etc). The "$1" represents the URL that Thunderbird will pass through to the script, that should be opened.

#!/bin/bash
firefox -P my-profile-name-here "$1" &

2. Configure Thunderbird To Ask About Https

Open the settings area, by clicking Edit > Settings


Search for config editor and click the button to open the config editor:


In the navbar, search for:

network.protocol-handler.warn-external.http

... and then double click each of the rows to turn them from false to true.


3. Click An Email Link

Now close the editor and click a link in one of your emails. For me, the first time doing this appeared to do nothing, but apparently it is supposed to open up a window asking how to open the email. If you get the window, then you can just tell it to use the script you created and skip the next step. If you are like me, ignore this and proceed with the next step.

4. Configure Thunderbird To Use The Script We Created

Open the settings area again by clicking: Edit > Settings


Scroll down to Files & Attachments and click on the action beside https as indicated below:

If you don't see an https action, you need to have performed the previous steps where we opened the config editor, and clicked a link. Go back and perform those steps.

Click the use other option, which will open a file browser. Navigate to your script and select it.

Close the settings area and you're all done! Emails will now open in the browser how you wish!

References

Last updated: 22nd October 2022
First published: 22nd October 2022

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch