Install Mailspring, the Best Free Email App on Linux, in a Distrobox Container!

Published: (December 28, 2025 at 10:48 PM EST)
4 min read
Source: Dev.to

Source: Dev.to

Mailspring – A Great Free, Open‑Source Email Client for Linux

From my experience, it’s actually the best free, open‑source, and underrated email app on Linux. See its GitHub repo.

  • The GUI is sharp and modern.
  • It has an excellent built‑in email language translator.
  • It follows the system’s light/dark theme (using a plug‑in system).
  • Many email providers are supported out‑of‑the‑box with a single‑sign‑on system.
  • It can run in the background with the --background option.
  • A Pro subscription is available for more features – see here!

But if you only use one email, an email client probably doesn’t matter much 😂

Why Not Geary?

Geary is the go‑to email client for many. With the adw‑gtk3 theme and the Legacy (GTK3) Theme Scheme Auto Switcher GNOME extension, it blends very well with GNOME and other Adwaita apps. It also integrates with GNOME Online Accounts.

Unfortunately, its Flatpak version is plagued with a non‑debuggable crashing issue (Geary issue #1679), making it unusable for me. Since I’m on Fedora Silverblue, I’m not willing to layer something like an email client, and I can’t get it to follow the system’s light/dark theme inside a container. Therefore, I uninstalled Geary and never looked back.

Why Not Evolution?

I don’t want to use an email client with a 1990s graphical interface.

Why Not Thunderbird?

I want my email client to be an email client, not also a calendar client, etc.

Table of Contents

  1. Install Distrobox and Podman
  2. Configure Distrobox to Use Podman
  3. Create a Container
  4. Enable x86‑64‑v3 Packages
  5. Install Required Packages
  6. Optional: Symlink Fonts and Fontconfig Directories on the Host
  7. Install Mailspring
  8. Export Mailspring to the Host
  9. Make Mailspring Follow the System’s Light/Dark Theme
  10. Make Mailspring Run in the Background on Startup and When It’s Closed
  11. Update the Container Automatically – Zero Maintenance!

Install Distrobox and Podman

The command will differ based on your package manager. Example for Arch‑based distros:

sudo pacman -S distrobox podman

On Fedora Silverblue, Podman is installed by default; you only need to layer Distrobox:

sudo rpm-ostree install distrobox

Note: Reboot after installing the layered package.

Configure Distrobox to Use Podman

echo 'container_manager="podman"' > ~/.config/distrobox/distrobox.conf

Create a Container

I use the openSUSE container image because:

  • It provides x86‑64‑v3 packages.
  • It follows a rolling‑release model, so I don’t have to manually upgrade the container.
distrobox-create \
  -i registry.opensuse.org/opensuse/distrobox:latest \
  -n email-dbx \
  -H ~/distrobox/email-dbx \
  --volume /run/dbus/system_bus_socket:/run/dbus/system_bus_socket

Add --nvidia if you have an NVIDIA GPU. See more here.

Enable x86‑64‑v3 Packages

Enter the container and update all packages first:

sudo zypper dup

Then enable the x86‑64‑v3 packages:

sudo zypper install patterns-glibc-hwcaps-x86_64_v3

Install Required Packages

sudo zypper install \
  zenity \
  mozilla-nspr \
  mozilla-nss \
  libcanberra-gtk3-module \
  libwebkitgtk-6_0-4

This is useful for multilingual users who want to change the font for a specific language.

Create the Required Directories Inside the Container

mkdir -p ~/.local/share
mkdir -p ~/.config/fontconfig
ln -s /var/home/archerallstars/.local/share/fonts ~/.local/share/
ln -s /var/home/archerallstars/.config/fontconfig/conf.d ~/.config/fontconfig/

Replace /var/home/archerallstars with your actual home directory.

Install Mailspring

  1. Go to the official download page and download the .rpm package.
  2. Inside the container, install the downloaded file:
sudo zypper install ./mailspring-1.16.0-0.1.x86_64.rpm

When prompted about the package’s signature, just ignore it (press i).

Export Mailspring to the Host

distrobox-export -a mailspring

You should now see Mailspring’s icon in your host’s application drawer. Exit the container with exit.

Make Mailspring Follow the System’s Light/Dark Theme

Thanks to Andrew Minion and his Mailspring Automatic Light‑Dark Mode script.

Install the Plug‑in

  1. Clone the repository (or download it as a zip).

    git clone https://github.com/andrewminion/mailspring-automatic-light-dark-mode.git
  2. Copy the entire directory into the container’s Mailspring plug‑in folder:

    cp -r mailspring-automatic-light-dark-mode ~/distrobox/email-dbx/.config/Mailspring/packages/
  3. In Mailspring, open Developer → Install a Plugin… and select the copied directory.

The plug‑in works immediately—no restart required. It will automatically switch Mailspring’s theme when you change the system’s light/dark mode.

Hide the Ancient Menu Bar (Optional)

After installing the plug‑in you can hide the old menu bar. Toggle the menu bar with Alt.

Hiding the ancient menu bar

Make Mailspring Run in the Background on Startup and When It’s Closed

Method 1 – Desktop Entry (Simple)

Create a desktop entry that launches Mailspring with the --background flag and place it in ~/.config/autostart/:

[Desktop Entry]
Name=Mailspring (Background)
Exec=mailspring --background
Type=Application
X-GNOME-Autostart-enabled=true

Method 2 – systemd User Service (Robust)

  1. Create the service file

    nano ~/.config/systemd/user/mailspring.service
    [Unit]
    Description=Mailspring
    RequiresMountsFor=/run/user/1000/containers
    
    [Service]
    Type=exec
    ExecStart=/usr/bin/distrobox-enter -n email-dbx -- mailspring --background
    Restart=always
    RestartSec=15
    TimeoutStopSec=30
  2. Create a timer to start the service after login

    nano ~/.config/systemd/user/mailspring.timer
    [Unit]
    Description=Start Mailspring service with some delay.
    
    [Timer]
    OnStartupSec=40
    RandomizedDelaySec=10
    Persistent=true
    
    [Install]
    WantedBy=timers.target
  3. Enable the timer

    systemctl --user daemon-reload && systemctl --user enable mailspring.timer

Update the Container Automatically – Zero Maintenance!

Simple One‑Liner (quick solution)

distrobox-enter -n email-dbx -- sudo zypper dup -y

You can schedule the above command with a systemd timer or a cron job on the host.

Full systemd Service & Timer (automatic upgrades for all containers)

  1. Service file

    nano ~/.config/systemd/user/dbx-upgrade.service
    [Unit]
    Description=Upgrade all Distrobox containers
    RequiresMountsFor=/run/user/1000/containers
    StartLimitBurst=3
    StartLimitIntervalSec=600
    
    [Service]
    Type=exec
    ExecStart=sh -c "distrobox-upgrade --all"
    Restart=on-failure
    RestartSec=60
  2. Timer file

    nano ~/.config/systemd/user/dbx-upgrade.timer
    [Unit]
    Description=Start Distrobox containers upgrade service with some delay.
    
    [Timer]
    OnStartupSec=45
    RandomizedDelaySec=15
    Persistent=true
    
    [Install]
    WantedBy=timers.target
  3. Enable the timer

    systemctl --user daemon-reload && systemctl --user enable dbx-upgrade.timer

This setup will automatically upgrade all rootless Distrobox containers on your system without manual intervention.


Credits

Cover Photo by Utsav Srestha on Unsplash.

Back to Blog

Related posts

Read more »

LearnixOS

Article URL: https://www.learnix-os.com Comments URL: https://news.ycombinator.com/item?id=46391599 Points: 26 Comments: 3...