about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/mailreaders
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/mailreaders')
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/aerc/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/aerc/runtime-sharedir.patch60
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/afew/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/alpine/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/astroid/default.nix56
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/balsa/default.nix77
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/bubblemail/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/claws-mail/default.nix191
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/claws-mail/mime.patch28
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/electron-mail/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution-ews/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution/default.nix133
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix35
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/hasmail/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/imapfilter.nix27
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/lumail/default.nix82
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mailcheck/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mailcheck/mailcheck-Makefile.patch22
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mailnag/default.nix107
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mailnag/goa-plugin.nix31
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mailpile/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mailspring/default.nix95
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mblaze/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/meli/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mlarchive2maildir/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mmh/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/msgviewer/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/mutt/default.nix96
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/neomutt/default.nix102
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/notbit/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/notmuch-bower/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/notmuch/default.nix99
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/notmuch/muchsync.nix23
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/notmuch/mutt.nix46
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/sylpheed/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix193
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/thunderbird-bin/release_sources.nix655
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-78.patch13
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/packages.nix65
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/update.nix7
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix23
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/trojita/default.nix83
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/trojita/fix-qttranslations-path.patch13
-rw-r--r--nixpkgs/pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix61
46 files changed, 3237 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/aerc/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/aerc/default.nix
new file mode 100644
index 000000000000..09ce39027b5a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/aerc/default.nix
@@ -0,0 +1,64 @@
+{ lib, buildGoModule, fetchFromSourcehut
+, ncurses, notmuch, scdoc
+, python3, w3m, dante
+}:
+
+buildGoModule rec {
+  pname = "aerc";
+  version = "0.5.2";
+
+  src = fetchFromSourcehut {
+    owner = "~sircmpwn";
+    repo = pname;
+    rev = version;
+    sha256 = "1ja639qry8h2d6y7qshf62ypkzs2rzady59p81scqh8nx0g9bils";
+  };
+
+  runVend = true;
+  vendorSha256 = "9PXdUH0gu8PGaKlRJCUF15W1/LxA+sv3Pwl2UnjYxWY=";
+
+  doCheck = false;
+
+  nativeBuildInputs = [
+    scdoc
+    python3.pkgs.wrapPython
+  ];
+
+  patches = [
+    ./runtime-sharedir.patch
+  ];
+
+  pythonPath = [
+    python3.pkgs.colorama
+  ];
+
+  buildInputs = [ python3 notmuch ];
+
+  buildPhase = "
+    runHook preBuild
+    # we use make instead of go build
+    runHook postBuild
+  ";
+
+  installPhase = ''
+    runHook preInstall
+    make PREFIX=$out GOFLAGS="$GOFLAGS -tags=notmuch" install
+    wrapPythonProgramsIn $out/share/aerc/filters "$out $pythonPath"
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/aerc --prefix PATH ":" \
+      "$out/share/aerc/filters:${lib.makeBinPath [ ncurses ]}"
+    wrapProgram $out/share/aerc/filters/html --prefix PATH ":" \
+      ${lib.makeBinPath [ w3m dante ]}
+  '';
+
+  meta = with lib; {
+    description = "An email client for your terminal";
+    homepage = "https://aerc-mail.org/";
+    maintainers = with maintainers; [ tadeokondrak ];
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/aerc/runtime-sharedir.patch b/nixpkgs/pkgs/applications/networking/mailreaders/aerc/runtime-sharedir.patch
new file mode 100644
index 000000000000..e08161e61eb6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/aerc/runtime-sharedir.patch
@@ -0,0 +1,60 @@
+From c715a96c693baa0e6c8ab3c96b6c10e0a40bf7af Mon Sep 17 00:00:00 2001
+From: Tadeo Kondrak <me@tadeo.ca>
+Date: Thu, 21 Jan 2021 10:40:49 +0100
+Subject: [PATCH] Fix aerc breaking every time the package is rebuilt.
+
+On NixOS, the SHAREDIR changes on every rebuild to the package, but aerc
+fills it in as part of the default config and then installs that config
+to the users home folder. Fix this by not substituting @SHAREDIR@ in the
+default config until runtime.
+---
+ Makefile         |  2 +-
+ config/config.go | 13 +++++++++++++
+ 2 files changed, 14 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 77f5e61..98cbc11 100644
+--- a/Makefile
++++ b/Makefile
+@@ -23,7 +23,7 @@ aerc: $(GOSRC)
+ 		-o $@
+
+ aerc.conf: config/aerc.conf.in
+-	sed -e 's:@SHAREDIR@:$(SHAREDIR):g' > $@ < config/aerc.conf.in
++	cat config/aerc.conf.in > $@
+
+ debug: $(GOSRC)
+ 	GOFLAGS="-tags=notmuch" \
+diff --git a/config/config.go b/config/config.go
+index 87d183a..cb6611a 100644
+--- a/config/config.go
++++ b/config/config.go
+@@ -470,6 +470,16 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
+ 			return nil, err
+ 		}
+ 	}
++	if sec, err := file.GetSection("templates"); err == nil {
++		if key, err := sec.GetKey("template-dirs"); err == nil {
++			sec.NewKey("template-dirs", strings.ReplaceAll(key.String(), "@SHAREDIR@", sharedir))
++		}
++	}
++	if sec, err := file.GetSection("ui"); err == nil {
++		if key, err := sec.GetKey("stylesets-dirs"); err == nil {
++			sec.NewKey("stylesets-dirs", strings.ReplaceAll(key.String(), "@SHAREDIR@", sharedir))
++		}
++	}
+ 	file.NameMapper = mapName
+ 	config := &AercConfig{
+ 		Bindings: BindingConfig{
+@@ -547,6 +557,9 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
+ 		return nil, err
+ 	}
+
++	for i, filter := range config.Filters {
++		config.Filters[i].Command = strings.ReplaceAll(filter.Command, "@SHAREDIR@", sharedir)
++	}
+ 	if ui, err := file.GetSection("general"); err == nil {
+ 		if err := ui.MapTo(&config.General); err != nil {
+ 			return nil, err
+--
+2.30.0
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/afew/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/afew/default.nix
new file mode 100644
index 000000000000..2e6c8cf02368
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/afew/default.nix
@@ -0,0 +1,45 @@
+{ lib, python3Packages, notmuch }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "afew";
+  version = "3.0.1";
+
+  src = python3Packages.fetchPypi {
+    inherit pname version;
+    sha256 = "0wpfqbqjlfb9z0hafvdhkm7qw56cr9kfy6n8vb0q42dwlghpz1ff";
+  };
+
+  nativeBuildInputs = with python3Packages; [ sphinx setuptools-scm ];
+
+  propagatedBuildInputs = with python3Packages; [
+    python3Packages.setuptools python3Packages.notmuch chardet dkimpy
+  ];
+
+  checkInputs = with python3Packages; [
+    freezegun notmuch
+  ];
+
+  makeWrapperArgs = [
+    ''--prefix PATH ':' "${notmuch}/bin"''
+  ];
+
+  outputs = [ "out" "doc" ];
+
+  postBuild =  ''
+    ${python3Packages.python.interpreter} setup.py build_sphinx -b html,man
+  '';
+
+  postInstall = ''
+    install -D -v -t $out/share/man/man1 build/sphinx/man/*
+    mkdir -p $out/share/doc/afew
+    cp -R build/sphinx/html/* $out/share/doc/afew
+  '';
+
+
+  meta = with lib; {
+    homepage = "https://github.com/afewmail/afew";
+    description = "An initial tagging script for notmuch mail";
+    license = licenses.isc;
+    maintainers = with maintainers; [ andir flokli ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/alpine/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/alpine/default.nix
new file mode 100644
index 000000000000..04f1732f7a5b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/alpine/default.nix
@@ -0,0 +1,33 @@
+{lib, stdenv, fetchurl, ncurses, tcl, openssl, pam, libkrb5
+, openldap
+}:
+
+stdenv.mkDerivation rec {
+  pname = "alpine";
+  version = "2.25";
+
+  src = fetchurl {
+    url = "http://alpine.x10host.com/alpine/release/src/${pname}-${version}.tar.xz";
+    sha256 = "0xppxhcbafq9qa1rns5zl0n238gai08xhvcf2as0nx7nh84ib2k5";
+  };
+
+  buildInputs = [
+    ncurses tcl openssl pam libkrb5 openldap
+  ];
+
+  hardeningDisable = [ "format" ];
+
+  configureFlags = [
+    "--with-ssl-include-dir=${openssl.dev}/include/openssl"
+    "--with-passfile=.pine-passfile"
+    "--with-c-client-target=slx"
+  ];
+
+  meta = with lib; {
+    description = "Console mail reader";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.linux;
+    homepage = "http://alpine.x10host.com/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/astroid/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/astroid/default.nix
new file mode 100644
index 000000000000..47e295de29d3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/astroid/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, gnome, gmime3, webkitgtk, ronn
+, libsass, notmuch, boost, wrapGAppsHook, glib-networking, protobuf
+, gtkmm3, libpeas, gsettings-desktop-schemas, gobject-introspection, python3
+
+# vim to be used, should support the GUI mode.
+, vim
+
+# additional python3 packages to be available within plugins
+, extraPythonPackages ? []
+}:
+
+stdenv.mkDerivation rec {
+  pname = "astroid";
+  version = "0.16";
+
+  src = fetchFromGitHub {
+    owner = "astroidmail";
+    repo = "astroid";
+    rev = "v${version}";
+    sha256 = "sha256-6xQniOLNUk8tDkooDN3Tp6sb43GqoynO6+fN9yhNqZ4=";
+  };
+
+  nativeBuildInputs = [
+    cmake ronn pkg-config wrapGAppsHook gobject-introspection
+    python3 python3.pkgs.wrapPython
+  ];
+
+  buildInputs = [
+    gtkmm3 gmime3 webkitgtk libsass libpeas
+    python3
+    notmuch boost gsettings-desktop-schemas gnome.adwaita-icon-theme
+    glib-networking protobuf
+    vim
+  ];
+
+  postPatch = ''
+    sed -i "s~gvim ~${vim}/bin/vim -g ~g" src/config.cc
+    sed -i "s~ -geom 10x10~~g" src/config.cc
+  '';
+
+  pythonPath = with python3.pkgs; requiredPythonModules [ pygobject3 ] ++ extraPythonPackages;
+  preFixup = ''
+    buildPythonPath "$out $pythonPath"
+    gappsWrapperArgs+=(
+      --prefix PYTHONPATH : "$program_PYTHONPATH"
+    )
+  '';
+
+  meta = with lib; {
+    homepage = "https://astroidmail.github.io/";
+    description = "GTK frontend to the notmuch mail system";
+    maintainers = with maintainers; [ bdimcheff SuprDewd ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/balsa/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/balsa/default.nix
new file mode 100644
index 000000000000..2f9832d9193d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/balsa/default.nix
@@ -0,0 +1,77 @@
+{ lib, stdenv
+, fetchurl
+, glib
+, gmime3
+, gnutls
+, gobject-introspection
+, gpgme
+, gtk3
+, gtksourceview
+, gtkspell3
+, intltool
+, libcanberra-gtk3
+, libesmtp
+, libical
+, libnotify
+, libsecret
+, openssl
+, pkg-config
+, webkitgtk
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "balsa";
+  version = "2.6.1";
+
+  src = fetchurl {
+    url = "https://pawsa.fedorapeople.org/balsa/${pname}-${version}.tar.bz2";
+    sha256 = "1xkxx801p7sbfkn0bh3cz85wra4xf1z1zhjqqc80z1z1nln7fhb4";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    intltool
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    gmime3
+    gnutls
+    gpgme
+    gtk3
+    gtksourceview
+    gtkspell3
+    libcanberra-gtk3
+    libesmtp
+    libical
+    libnotify
+    libsecret
+    openssl
+    webkitgtk
+  ];
+
+  configureFlags = [
+    "--with-canberra"
+    "--with-gtksourceview"
+    "--with-libsecret"
+    "--with-ssl"
+    "--with-unique"
+    "--without-gnome"
+    "--with-spell-checker=gtkspell"
+  ];
+
+  NIX_CFLAGS_COMPILE = "-I${glib.dev}/include/gio-unix-2.0";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://pawsa.fedorapeople.org/balsa/";
+    description = "An e-mail client for GNOME";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/bubblemail/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/bubblemail/default.nix
new file mode 100644
index 000000000000..d415eb4e51f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/bubblemail/default.nix
@@ -0,0 +1,76 @@
+{ lib
+, fetchFromGitLab
+, gettext
+, gtk3
+, python3Packages
+, gdk-pixbuf
+, libnotify
+, gst_all_1
+, libsecret
+, wrapGAppsHook
+, gsettings-desktop-schemas
+, gnome-online-accounts
+, glib
+, gobject-introspection
+, folks
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "bubblemail";
+  version = "1.3";
+
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = "razer";
+    repo = "bubblemail";
+    rev = "v${version}";
+    sha256 = "FEIdEoZBlM28F5kSMoln7KACwetb8hp+qix1P+DIE8k=";
+  };
+
+  buildInputs = [
+    gtk3
+    gdk-pixbuf
+    glib
+    libnotify
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+    gst_all_1.gst-plugins-good
+    gst_all_1.gst-plugins-bad
+    libsecret
+    gnome-online-accounts
+    folks
+  ];
+
+  nativeBuildInputs = [
+    gettext
+    wrapGAppsHook
+    python3Packages.pillow
+    # For setup-hook
+    gobject-introspection
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    gsettings-desktop-schemas
+    pygobject3
+    dbus-python
+    pyxdg
+  ];
+
+  # See https://nixos.org/nixpkgs/manual/#ssec-gnome-common-issues-double-wrapped
+  dontWrapGApps = true;
+
+  # https://github.com/NixOS/nixpkgs/issues/56943
+  strictDeps = false;
+
+  preFixup = ''
+    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
+
+  meta = with lib; {
+    description = "An extensible mail notification service.";
+    homepage = "http://bubblemail.free.fr/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ doronbehar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/claws-mail/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/claws-mail/default.nix
new file mode 100644
index 000000000000..5090b1fd0278
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/claws-mail/default.nix
@@ -0,0 +1,191 @@
+{ stdenv, lib, fetchgit, fetchpatch, wrapGAppsHook, autoreconfHook, bison, flex
+, curl, gtk2, gtk3, pkg-config, python2, python3, shared-mime-info
+, glib-networking, gsettings-desktop-schemas
+
+# Selector between the GTK+ 3 and GTK+ 2 releases.
+, useGtk3
+
+# Package compatibility: old parameters whose name were not directly derived
+, enablePgp ? true
+, enablePluginNotificationDialogs ? true
+, enablePluginNotificationSounds ? true
+, enablePluginPdf ? true
+, enablePluginRavatar ? true
+, enableSpellcheck ? true
+
+# Arguments to include external libraries
+, enableLibSM ? true, libSM
+, enableGnuTLS ? true, gnutls
+, enableEnchant ? enableSpellcheck, enchant
+, enableDbus ? true, dbus, dbus-glib
+, enableLdap ? true, openldap
+, enableNetworkManager ? true, networkmanager
+, enableLibetpan ? true, libetpan
+, enableValgrind ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind, valgrind
+, enableSvg ? true, librsvg
+
+# Configure claws-mail's plugins
+, enablePluginAcpiNotifier ? true
+, enablePluginAddressKeeper ? true
+, enablePluginArchive ? true, libarchive
+, enablePluginAttRemover ? true
+, enablePluginAttachWarner ? true
+, enablePluginBogofilter ? true
+, enablePluginBsfilter ? true
+, enablePluginClamd ? true
+, enablePluginDillo ? true
+, enablePluginFancy ? useGtk3, libsoup, webkitgtk
+, enablePluginFetchInfo ? true
+, enablePluginLibravatar ? enablePluginRavatar
+, enablePluginLitehtmlViewer ? true, gumbo
+, enablePluginMailmbox ? true
+, enablePluginManageSieve ? true
+, enablePluginNewMail ? true
+, enablePluginNotification ? (enablePluginNotificationDialogs || enablePluginNotificationSounds), libcanberra-gtk2, libcanberra-gtk3, libnotify
+, enablePluginPdfViewer ? enablePluginPdf, poppler
+, enablePluginPerl ? true, perl
+, enablePluginPython ? true
+, enablePluginPgp ? enablePgp, gnupg, gpgme
+, enablePluginRssyl ? true, libxml2
+, enablePluginSmime ? true
+, enablePluginSpamassassin ? true
+, enablePluginSpamReport ? true
+, enablePluginTnefParse ? true, libytnef
+, enablePluginVcalendar ? true, libical
+}:
+
+with lib;
+
+let
+  # Last release and hash for both the GTK+ 3 and GTK+ 2 version.
+  version = if useGtk3 then "4.0.0" else "3.18.0";
+
+  gtk2src = {
+    sha256 = "1vsiy3xsppw4d8ylsz70wsyrvmgy88lp2hj7vrc353ckny80r9lh";
+  };
+
+  gtk3src = {
+    sha256 = "0mwnjiqg2sj61va0y9yi3v52iyr5kzmbnvsqxav3a48m2f8p27qn";
+  };
+
+  python = if useGtk3 then python3 else python2;
+  pythonPkgs = if useGtk3
+    then
+      with python.pkgs; [ python wrapPython pygobject3 ]
+    else
+      with python.pkgs; [ python wrapPython pygtk pygobject2 ];
+
+  features = [
+    { flags = [ "acpi_notifier-plugin" ]; enabled = enablePluginAcpiNotifier; }
+    { flags = [ "address_keeper-plugin" ]; enabled = enablePluginAddressKeeper; }
+    { flags = [ "archive-plugin" ]; enabled = enablePluginArchive; deps = [ libarchive ]; }
+    { flags = [ "att_remover-plugin" ]; enabled = enablePluginAttRemover; }
+    { flags = [ "attachwarner-plugin" ]; enabled = enablePluginAttachWarner; }
+    { flags = [ "bogofilter-plugin" ]; enabled = enablePluginBogofilter; }
+    { flags = [ "bsfilter-plugin" ]; enabled = enablePluginBsfilter; }
+    { flags = [ "clamd-plugin" ]; enabled = enablePluginClamd; }
+    { flags = [ "dbus" ]; enabled = enableDbus; deps = [ dbus dbus-glib ]; }
+    { flags = [ "dillo-plugin" ]; enabled = enablePluginDillo; }
+    { flags = [ "enchant" ]; enabled = enableEnchant; deps = [ enchant ]; }
+    { flags = [ "fancy-plugin" ]; enabled = enablePluginFancy; deps = [ libsoup webkitgtk ]; }
+    { flags = [ "fetchinfo-plugin" ]; enabled = enablePluginFetchInfo; }
+    { flags = [ "gnutls" ]; enabled = enableGnuTLS; deps = [ gnutls ]; }
+    { flags = [ "ldap" ]; enabled = enableLdap; deps = [ openldap ]; }
+    { flags = [ "libetpan" ]; enabled = enableLibetpan; deps = [ libetpan ]; }
+    { flags = [ "libravatar-plugin" ]; enabled = enablePluginLibravatar; }
+    { flags = [ "libsm" ]; enabled = enableLibSM; deps = [ libSM ]; }
+    { flags = [ "litehtml_viewer-plugin" ]; enabled = enablePluginLitehtmlViewer; deps = [ gumbo ]; }
+    { flags = [ "mailmbox-plugin" ]; enabled = enablePluginMailmbox; }
+    { flags = [ "managesieve-plugin" ]; enabled = enablePluginManageSieve; }
+    { flags = [ "networkmanager" ]; enabled = enableNetworkManager; deps = [ networkmanager ]; }
+    { flags = [ "newmail-plugin" ]; enabled = enablePluginNewMail; }
+    { flags = [ "notification-plugin" ]; enabled = enablePluginNotification; deps = [ libnotify ] ++ [(if useGtk3 then libcanberra-gtk3 else libcanberra-gtk2)]; }
+    { flags = [ "pdf_viewer-plugin" ]; enabled = enablePluginPdfViewer; deps = [ poppler ]; }
+    { flags = [ "perl-plugin" ]; enabled = enablePluginPerl; deps = [ perl ]; }
+    { flags = [ "pgpcore-plugin" "pgpinline-plugin" "pgpmime-plugin" ]; enabled = enablePluginPgp; deps = [ gnupg gpgme ]; }
+    { flags = [ "python-plugin" ]; enabled = enablePluginPython; }
+    { flags = [ "rssyl-plugin" ]; enabled = enablePluginRssyl; deps = [ libxml2 ]; }
+    { flags = [ "smime-plugin" ]; enabled = enablePluginSmime; }
+    { flags = [ "spam_report-plugin" ]; enabled = enablePluginSpamReport; }
+    { flags = [ "spamassassin-plugin" ]; enabled = enablePluginSpamassassin; }
+    { flags = [ "svg" ]; enabled = enableSvg; deps = [ librsvg ]; }
+    { flags = [ "tnef_parse-plugin" ]; enabled = enablePluginTnefParse; deps = [ libytnef ]; }
+    { flags = [ "valgrind" ]; enabled = enableValgrind; deps = [ valgrind ]; }
+    { flags = [ "vcalendar-plugin" ]; enabled = enablePluginVcalendar; deps = [ libical ]; }
+  ];
+in stdenv.mkDerivation rec {
+  pname = "claws-mail";
+  inherit version;
+
+  src = fetchgit ({
+    rev = version;
+    url = "git://git.claws-mail.org/claws.git";
+  } // (if useGtk3 then gtk3src else gtk2src));
+
+  outputs = [ "out" "dev" ];
+
+  patches = [
+    ./mime.patch
+
+    # Fixes a bug with the automatic authentication method, resulting in errors
+    # with certain mail providers.
+    # <https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4497>
+    # This MUST be removed for the next release.
+    (fetchpatch {
+      name = "fix-automatic-auth.patch";
+      url = "https://git.claws-mail.org/?p=claws.git;a=patch;h=9c2585c58b49815a0eab8d683f0a94f75cbbe64e";
+      sha256 = "0v8v5q2p4h93lp7yq3gnlvarsrcssv96aks1wqy3187vsr4kdw7a";
+    })
+  ];
+
+  preConfigure = ''
+    # autotools check tries to dlopen libpython as a requirement for the python plugin
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}${python}/lib
+    # generate version without .git
+    [ -e version ] || echo "echo ${version}" > version
+  '';
+
+  postPatch = ''
+    substituteInPlace src/procmime.c \
+        --subst-var-by MIMEROOTDIR ${shared-mime-info}/share
+  '';
+
+  nativeBuildInputs = [ autoreconfHook pkg-config bison flex wrapGAppsHook ];
+  propagatedBuildInputs = pythonPkgs;
+
+  buildInputs =
+    [ curl gsettings-desktop-schemas glib-networking ]
+    ++ [(if useGtk3 then gtk3 else gtk2)]
+    ++ concatMap (f: optionals f.enabled f.deps) (filter (f: f ? deps) features)
+  ;
+
+  configureFlags =
+    [
+      "--disable-manual"   # Missing docbook-tools, e.g., docbook2html
+      "--disable-compface" # Missing compface library
+      "--disable-jpilot"   # Missing jpilot library
+
+      "--disable-gdata-plugin" # Complains about missing libgdata, even when provided
+    ] ++
+    (map (feature: map (flag: strings.enableFeature feature.enabled flag) feature.flags) features);
+
+  enableParallelBuilding = true;
+
+  preFixup = ''
+    buildPythonPath "$out $pythonPkgs"
+    gappsWrapperArgs+=(--prefix XDG_DATA_DIRS : "${shared-mime-info}/share" --prefix PYTHONPATH : "$program_PYTHONPATH")
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/applications
+    cp claws-mail.desktop $out/share/applications
+  '';
+
+  meta = {
+    description = "The user-friendly, lightweight, and fast email client";
+    homepage = "https://www.claws-mail.org/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ fpletz globin orivej oxzi ajs124 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/claws-mail/mime.patch b/nixpkgs/pkgs/applications/networking/mailreaders/claws-mail/mime.patch
new file mode 100644
index 000000000000..2ff4269c3329
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/claws-mail/mime.patch
@@ -0,0 +1,28 @@
+diff --git a/src/procmime.c b/src/procmime.c
+index bd3239e..06a3b26 100644
+--- a/src/procmime.c
++++ b/src/procmime.c
+@@ -1144,20 +1144,16 @@ GList *procmime_get_mime_type_list(void)
+ 	MimeType *mime_type;
+ 	gboolean fp_is_glob_file = TRUE;
+ 
+ 	if (mime_type_list) 
+ 		return mime_type_list;
+-	
+-#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__)
+-	if ((fp = claws_fopen(DATAROOTDIR "/mime/globs", "rb")) == NULL) 
+-#else
+-	if ((fp = claws_fopen("/usr/share/mime/globs", "rb")) == NULL) 
+-#endif
++
++	if ((fp = claws_fopen("@MIMEROOTDIR@/mime/globs", "rb")) == NULL)
+ 	{
+ 		fp_is_glob_file = FALSE;
+ 		if ((fp = claws_fopen("/etc/mime.types", "rb")) == NULL) {
+ 			if ((fp = claws_fopen(SYSCONFDIR "/mime.types", "rb")) 
+ 				== NULL) {
+ 				FILE_OP_ERROR(SYSCONFDIR "/mime.types", 
+ 					"claws_fopen");
+ 				return NULL;
+ 			}
+
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/electron-mail/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/electron-mail/default.nix
new file mode 100644
index 000000000000..1f7d663cf8e5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/electron-mail/default.nix
@@ -0,0 +1,33 @@
+{ appimageTools, lib, fetchurl }:
+
+let
+  pname = "electron-mail";
+  version = "4.12.2";
+  name = "ElectronMail-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/vladimiry/ElectronMail/releases/download/v${version}/electron-mail-${version}-linux-x86_64.AppImage";
+    sha256 = "D+0qoIb0EwUVbgKOiKQpqoLDgm8l/UKDWm/BjhW4MYU=";
+  };
+
+  appimageContents = appimageTools.extract { inherit name src; };
+in appimageTools.wrapType2 {
+  inherit name src;
+
+  extraInstallCommands = ''
+    mv $out/bin/${name} $out/bin/${pname}
+
+    install -m 444 -D ${appimageContents}/${pname}.desktop -t $out/share/applications
+    substituteInPlace $out/share/applications/${pname}.desktop \
+      --replace 'Exec=AppRun' 'Exec=${pname}'
+    cp -r ${appimageContents}/usr/share/icons $out/share
+  '';
+
+  meta = with lib; {
+    description = "ElectronMail is an Electron-based unofficial desktop client for ProtonMail";
+    homepage = "https://github.com/vladimiry/ElectronMail";
+    license = licenses.mit;
+    maintainers = [ maintainers.princemachiavelli ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution-ews/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution-ews/default.nix
new file mode 100644
index 000000000000..baad7602cf05
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution-ews/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, gnome, cmake, gettext, intltool, pkg-config, evolution-data-server, evolution
+, sqlite, gtk3, webkitgtk, libgdata, libmspack }:
+
+stdenv.mkDerivation rec {
+  pname = "evolution-ews";
+  version = "3.42.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1byi1ksimbycd0daxp5j240r3n5qlaa4b3c5l9jzkjr9g3gkclsq";
+  };
+
+  nativeBuildInputs = [ cmake gettext intltool pkg-config ];
+
+  buildInputs = [
+    evolution-data-server evolution
+    sqlite libgdata
+    gtk3 webkitgtk
+    libmspack
+  ];
+
+  cmakeFlags = [
+    # Building with libmspack as recommended: https://wiki.gnome.org/Apps/Evolution/Building#Build_evolution-ews
+    "-DWITH_MSPACK=ON"
+    # don't try to install into ${evolution}
+    "-DFORCE_INSTALL_PREFIX=ON"
+  ];
+
+   passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "evolution-ews";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Evolution connector for Microsoft Exchange Server protocols";
+    homepage = "https://gitlab.gnome.org/GNOME/evolution-ews";
+    license = "LGPL-2.1-only OR LGPL-3.0-only"; # https://gitlab.gnome.org/GNOME/evolution-ews/issues/111
+    maintainers = [ maintainers.dasj19 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution/default.nix
new file mode 100644
index 000000000000..564a4c5499ea
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution/default.nix
@@ -0,0 +1,133 @@
+{ lib, stdenv
+, cmake
+, ninja
+, intltool
+, fetchurl
+, libxml2
+, webkitgtk
+, highlight
+, pkg-config
+, gtk3
+, glib
+, libnotify
+, libpst
+, gspell
+, evolution-data-server
+, libgdata
+, libgweather
+, glib-networking
+, gsettings-desktop-schemas
+, wrapGAppsHook
+, itstool
+, shared-mime-info
+, libical
+, db
+, gcr
+, sqlite
+, gnome
+, librsvg
+, gdk-pixbuf
+, libsecret
+, nss
+, nspr
+, icu
+, libcanberra-gtk3
+, bogofilter
+, gst_all_1
+, procps
+, p11-kit
+, openldap
+, spamassassin
+}:
+
+stdenv.mkDerivation rec {
+  pname = "evolution";
+  version = "3.42.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/evolution/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0yj2hifis5m2cy59skn07d8n69444vlsw62ildr1fv67zxbblib8";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    intltool
+    itstool
+    libxml2
+    ninja
+    pkg-config
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gnome.adwaita-icon-theme
+    bogofilter
+    db
+    evolution-data-server
+    gcr
+    gdk-pixbuf
+    glib
+    glib-networking
+    gnome.gnome-desktop
+    gsettings-desktop-schemas
+    gst_all_1.gst-plugins-base
+    gst_all_1.gstreamer
+    gtk3
+    gspell
+    highlight
+    icu
+    libcanberra-gtk3
+    libgdata
+    libgweather
+    libical
+    libnotify
+    libpst
+    librsvg
+    libsecret
+    nspr
+    nss
+    openldap
+    p11-kit
+    procps
+    shared-mime-info
+    sqlite
+    webkitgtk
+  ];
+
+  propagatedUserEnvPkgs = [
+    evolution-data-server
+  ];
+
+  cmakeFlags = [
+    "-DENABLE_AUTOAR=OFF"
+    "-DENABLE_LIBCRYPTUI=OFF"
+    "-DENABLE_YTNEF=OFF"
+    "-DWITH_SPAMASSASSIN=${spamassassin}/bin/spamassassin"
+    "-DWITH_SA_LEARN=${spamassassin}/bin/sa-learn"
+    "-DWITH_BOGOFILTER=${bogofilter}/bin/bogofilter"
+    "-DWITH_OPENLDAP=${openldap}"
+  ];
+
+  requiredSystemFeatures = [
+    "big-parallel"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "evolution";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  PKG_CONFIG_LIBEDATASERVERUI_1_2_UIMODULEDIR = "${placeholder "out"}/lib/evolution-data-server/ui-modules";
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Apps/Evolution";
+    description = "Personal information management application that provides integrated mail, calendaring and address book functionality";
+    maintainers = teams.gnome.members;
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix b/nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix
new file mode 100644
index 000000000000..7837393926f6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix
@@ -0,0 +1,35 @@
+{ lib, makeWrapper, symlinkJoin, gnome, plugins }:
+
+symlinkJoin {
+  name = "evolution-with-plugins";
+  paths = [ gnome.evolution-data-server ] ++ plugins;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    for i in $out/bin/* $out/libexec/**; do
+    if [ ! -d $i ]; then
+      echo wrapping $i
+      wrapProgram $i --set EDS_EXTRA_PREFIXES "${lib.concatStringsSep ":" plugins}"
+    fi
+    done
+
+    fixSymlink () {
+     local link=$1
+     local target=$(readlink $link);
+     local newtarget=$(sed "s@/nix/store/[^/]*/@$out/@" <<< "$target")
+     if [[ $target != $newtarget ]] && [[ -d $newtarget ]]; then
+       echo fixing link to point to $newtarget instead of $target
+       rm $link
+       ln -s $newtarget $link
+     fi
+    }
+
+    fixSymlink $out/share/dbus-1/service
+    fixSymlink $out/lib/systemd/user
+    for i in $out/share/dbus-1/services/*.service $out/lib/systemd/user/*.service; do
+      echo fixing service file $i to point to $out
+      sed -i "s@/nix/store/[^/]*/@$out/@" $i
+    done
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/hasmail/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/hasmail/default.nix
new file mode 100644
index 000000000000..b2ec2a743f3d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/hasmail/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, buildGoModule
+, fetchFromGitHub
+, pkg-config
+, gobject-introspection
+, pango
+, cairo
+, gtk2
+}:
+
+buildGoModule rec {
+  pname = "hasmail-unstable";
+  version = "2019-08-24";
+
+  src = fetchFromGitHub {
+    owner = "jonhoo";
+    repo = "hasmail";
+    rev = "eb52536d26815383bfe5990cd5ace8bb9d036c8d";
+    sha256 = "1p6kwa5xk1mb1fkkxz1b5rcyp5kb4zc8nfif1gk6fab6wbdj9ia1";
+  };
+
+  vendorSha256 = "0sblgjmn3i3k31jfq5zy3bx7bv5z2cg6rjzr7aj87c57yhzzcmk7";
+
+  doCheck = false;
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    pango
+    cairo
+    gtk2
+  ];
+
+  meta = with lib; {
+    description = "Simple tray icon for detecting new email on IMAP servers";
+    homepage = "https://github.com/jonhoo/hasmail";
+    license = licenses.unlicense;
+    maintainers = with maintainers; [ doronbehar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix
new file mode 100644
index 000000000000..b1c709b055b9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/himalaya/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, stdenv
+, rustPlatform
+, fetchFromGitHub
+, openssl
+, pkg-config
+, installShellFiles
+, enableCompletions ? stdenv.hostPlatform == stdenv.buildPlatform
+, Security
+, libiconv
+}:
+rustPlatform.buildRustPackage rec {
+  pname = "himalaya";
+  version = "0.4.0";
+
+  src = fetchFromGitHub {
+    owner = "soywod";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-6RgT/SxO4vsk8Yx2AbaNIFvnAvgDmeTXvb/v6nUJxhc=";
+  };
+
+  cargoSha256 = "sha256-NEuIh7FwIdAWzlChna3+G0VukfV8nYZfVWa+3LxQCIA=";
+
+  # use --lib flag to avoid test with imap server
+  # https://github.com/soywod/himalaya/issues/145
+  cargoTestFlags = [ "--lib" ];
+
+  nativeBuildInputs = [ ]
+    ++ lib.optionals (enableCompletions) [ installShellFiles ]
+    ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ pkg-config ];
+
+  buildInputs =
+    if stdenv.hostPlatform.isDarwin then [
+      Security
+      libiconv
+    ] else [
+      openssl
+    ];
+
+  postInstall = lib.optionalString enableCompletions ''
+    # Install shell function
+    installShellCompletion --cmd himalaya \
+      --bash <($out/bin/himalaya completion bash) \
+      --fish <($out/bin/himalaya completion fish) \
+      --zsh <($out/bin/himalaya completion zsh)
+  '';
+
+  meta = with lib; {
+    description = "CLI email client written in Rust";
+    homepage = "https://github.com/soywod/himalaya";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ yanganto ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/imapfilter.nix b/nixpkgs/pkgs/applications/networking/mailreaders/imapfilter.nix
new file mode 100644
index 000000000000..bed71202c4fe
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/imapfilter.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, openssl, lua, pcre2 }:
+
+stdenv.mkDerivation rec {
+  pname = "imapfilter";
+  version = "2.7.5";
+
+  src = fetchFromGitHub {
+    owner = "lefcha";
+    repo = "imapfilter";
+    rev = "v${version}";
+    sha256 = "nbVwbPkNbJz4GHhvOp+QVgiBqKA/HR34p4x3NXJB7ig=";
+  };
+  makeFlags = [
+    "SSLCAFILE=/etc/ssl/certs/ca-bundle.crt"
+    "PREFIX=$(out)"
+  ];
+
+  buildInputs = [ openssl pcre2 lua ];
+
+  meta = {
+    homepage = "https://github.com/lefcha/imapfilter";
+    description = "Mail filtering utility";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ doronbehar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/lumail/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/lumail/default.nix
new file mode 100644
index 000000000000..878b778c5a50
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/lumail/default.nix
@@ -0,0 +1,82 @@
+{ lib, stdenv, fetchurl, pkg-config, lua, file, ncurses, gmime, pcre-cpp
+, perl, perlPackages, makeWrapper
+, debugBuild ? false
+, alternativeGlobalConfigFilePath ? null
+}:
+
+let
+  version    = "3.1";
+  binaryName = if debugBuild then "lumail2-debug" else "lumail2";
+  alternativeConfig = builtins.toFile "lumail2.lua"
+    (builtins.readFile alternativeGlobalConfigFilePath);
+
+  globalConfig = if alternativeGlobalConfigFilePath == null then ''
+    mkdir -p $out/etc/lumail2
+    cp global.config.lua $out/etc/lumail2.lua
+    for n in ./lib/*.lua; do
+      cp "$n" $out/etc/lumail2/
+    done
+  '' else ''
+    ln -s ${alternativeConfig} $out/etc/lumail2.lua
+  '';
+
+  getPath  = type : "${lua}/lib/?.${type};";
+  luaPath  = getPath "lua";
+  luaCPath = getPath "so";
+in
+stdenv.mkDerivation {
+  pname = "lumail";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://lumail.org/download/lumail-${version}.tar.gz";
+    sha256 = "0vj7p7f02m3w8wb74ilajcwznc4ai4h2ikkz9ildy0c00aqsi5w4";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkg-config makeWrapper ];
+  buildInputs = [
+    lua file ncurses gmime pcre-cpp
+    perl perlPackages.JSON perlPackages.NetIMAPClient
+  ];
+
+  preConfigure = ''
+    sed -e 's|"/etc/lumail2|LUMAIL_LUAPATH"/..|' -i src/lumail2.cc src/imap_proxy.cc
+
+    perlFlags=
+    for i in $(IFS=:; echo $PERL5LIB); do
+        perlFlags="$perlFlags -I$i"
+    done
+
+    sed -e "s|^#\!\(.*/perl.*\)$|#\!\1$perlFlags|" -i perl.d/imap-proxy
+  '';
+
+  buildFlags = lib.optional debugBuild "lumail2-debug";
+
+  installPhase = ''
+    mkdir -p $out/bin || true
+    install -m755 ${binaryName} $out/bin/
+  ''
+  + globalConfig
+  + ''
+    wrapProgram $out/bin/${binaryName} \
+        --prefix LUA_PATH : "${luaPath}" \
+        --prefix LUA_CPATH : "${luaCPath}"
+  '';
+
+  makeFlags = [
+    "LVER=lua"
+    "PREFIX=$(out)"
+    "SYSCONFDIR=$(out)/etc"
+    "LUMAIL_LIBS=$(out)/etc/lumail2"
+  ];
+
+  meta = with lib; {
+    description = "Console-based email client";
+    homepage = "https://lumail.org/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [orivej];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mailcheck/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/mailcheck/default.nix
new file mode 100644
index 000000000000..e9e5fb5f70e9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mailcheck/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "mailcheck";
+  version = "1.91.2";
+
+  patches = [ ./mailcheck-Makefile.patch ];
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mailcheck/mailcheck_${version}.tar.gz";
+    sha256 = "0p0azaxsnjvjbg41ycicc1i0kzw6jiynq8k49cfkdhlckxfdm9kc";
+  };
+
+  meta = {
+    description = "Simple command line tool to check for new messages";
+    homepage    = "http://mailcheck.sourceforge.net/";
+    license     = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ kovirobi ];
+    platforms   = lib.platforms.linux;
+    longDescription = ''
+      A simple command line tool to check for new mail in local mbox and
+      maildir and remote POP3 and IMAP mailboxes.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mailcheck/mailcheck-Makefile.patch b/nixpkgs/pkgs/applications/networking/mailreaders/mailcheck/mailcheck-Makefile.patch
new file mode 100644
index 000000000000..46b3bff4f7a9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mailcheck/mailcheck-Makefile.patch
@@ -0,0 +1,22 @@
+diff -u a/Makefile b/Makefile
+--- a/Makefile	2015-04-05 19:31:41.871227295 +0100
++++ b/Makefile	2015-04-05 19:42:49.743517508 +0100
+@@ -1,3 +1,5 @@
++prefix=$(out)
++
+ all: mailcheck
+ 
+ debug: mailcheck.c netrc.c netrc.h socket.c
+@@ -7,8 +9,10 @@
+ 	$(CC) -Wall -O2 mailcheck.c netrc.c socket.c -s -o mailcheck
+ 
+ install: mailcheck
+-	install mailcheck $(prefix)/usr/bin
+-	install -m 644 mailcheckrc $(prefix)/etc
++	[ -d $(prefix)/bin ] || mkdir $(prefix)/bin
++	[ -d $(prefix)/etc ] || mkdir $(prefix)/etc
++	install mailcheck $(prefix)/bin/
++	install -m 644 mailcheckrc $(prefix)/etc/
+ 
+ distclean: clean
+ 
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mailnag/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/mailnag/default.nix
new file mode 100644
index 000000000000..9a2bd563fc8d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mailnag/default.nix
@@ -0,0 +1,107 @@
+{ lib
+, fetchFromGitHub
+, gettext
+, xorg # for lndir
+, gtk3
+, python3Packages
+, gdk-pixbuf
+, libnotify
+, gst_all_1
+, libsecret
+, wrapGAppsHook
+, gsettings-desktop-schemas
+, glib
+, gobject-introspection
+# Available plugins (can be overriden)
+, availablePlugins
+# Used in the withPlugins interface at passthru, can be overrided directly, or
+# prefarably via e.g: `mailnag.withPlugins([mailnag.availablePlugins.goa])`
+, mailnag
+, userPlugins ? [ ]
+, pluginsDeps ? [ ]
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "mailnag";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "pulb";
+    repo = "mailnag";
+    rev = "v${version}";
+    sha256 = "0m1cyzwzm7z4p2v31dx098a1iar7dbilwyjcxiqnjx05nlmiqvgf";
+  };
+
+  buildInputs = [
+    gtk3
+    gdk-pixbuf
+    glib
+    libnotify
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+    gst_all_1.gst-plugins-good
+    gst_all_1.gst-plugins-bad
+    gobject-introspection
+    libsecret
+  ] ++ pluginsDeps;
+
+  nativeBuildInputs = [
+    gettext
+    wrapGAppsHook
+    # To later add plugins to
+    xorg.lndir
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    gsettings-desktop-schemas
+    pygobject3
+    dbus-python
+    pyxdg
+  ];
+
+  passthru = {
+    inherit availablePlugins;
+    withPlugins =
+      plugs:
+      let
+        # goa plugin requires gio's gnome-online-accounts which requires making sure
+        # mailnag runs with GI_TYPELIB_PATH containing the path to Goa-1.0.typelib.
+        # This is handled best by adding the plugins' deps to buildInputs and let
+        # wrapGAppsHook handle that.
+        pluginsDeps = lib.flatten (lib.catAttrs "buildInputs" plugs);
+        self = mailnag;
+      in
+        self.override {
+          userPlugins = plugs;
+          inherit pluginsDeps;
+        };
+  };
+
+  # See https://nixos.org/nixpkgs/manual/#ssec-gnome-common-issues-double-wrapped
+  dontWrapGApps = true;
+
+  preFixup = ''
+    substituteInPlace $out/${python3Packages.python.sitePackages}/Mailnag/common/dist_cfg.py \
+      --replace "/usr/" $out/
+    for desktop_file in $out/share/applications/*.desktop; do
+      substituteInPlace "$desktop_file" \
+      --replace "/usr/bin" $out/bin
+    done
+    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
+
+  # Actually install plugins
+  postInstall = ''
+    for plug in ${builtins.toString userPlugins}; do
+      lndir $plug/${python3Packages.python.sitePackages} $out/${python3Packages.python.sitePackages}
+    done
+  '';
+
+  meta = with lib; {
+    description = "An extensible mail notification daemon";
+    homepage = "https://github.com/pulb/mailnag";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ doronbehar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mailnag/goa-plugin.nix b/nixpkgs/pkgs/applications/networking/mailreaders/mailnag/goa-plugin.nix
new file mode 100644
index 000000000000..1def97bd62d7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mailnag/goa-plugin.nix
@@ -0,0 +1,31 @@
+{ lib
+, fetchFromGitHub
+, python3Packages
+, gobject-introspection
+, gnome-online-accounts
+}:
+
+python3Packages.buildPythonPackage rec {
+  pname = "mailnag-goa-plugin";
+  version = "2.0.0";
+
+  src = fetchFromGitHub {
+    owner = "pulb";
+    repo = "mailnag-goa-plugin";
+    rev = "v${version}";
+    sha256 = "0bij6cy96nhq7xzslx0fnhmiac629h0x4wgy67k4i4npwqw10680";
+  };
+
+  buildInputs = [
+    gobject-introspection
+    gnome-online-accounts
+  ];
+
+  meta = with lib; {
+    description = "Mailnag GNOME Online Accounts plugin.";
+    homepage = "https://github.com/pulb/mailnag-goa-plugin";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ doronbehar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mailpile/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/mailpile/default.nix
new file mode 100644
index 000000000000..cab43750a56e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mailpile/default.nix
@@ -0,0 +1,52 @@
+{ lib, fetchFromGitHub, python2Packages, gnupg1orig, openssl, git }:
+
+python2Packages.buildPythonApplication rec {
+  pname = "mailpile";
+  version = "1.0.0rc2";
+
+  src = fetchFromGitHub {
+    owner = "mailpile";
+    repo = "Mailpile";
+    rev = version;
+    sha256 = "1z5psh00fjr8gnl4yjcl4m9ywfj24y1ffa2rfb5q8hq4ksjblbdj";
+  };
+
+  postPatch = ''
+    patchShebangs scripts
+  '';
+
+  nativeBuildInputs = with python2Packages; [ pbr git ];
+  PBR_VERSION=version;
+
+  propagatedBuildInputs = with python2Packages; [
+    appdirs
+    cryptography
+    fasteners
+    gnupg1orig
+    jinja2
+    pgpdump
+    pillow
+    python2Packages.lxml
+    spambayes
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/mailpile \
+      --prefix PATH ":" "${lib.makeBinPath [ gnupg1orig openssl ]}" \
+      --set-default MAILPILE_SHARED "$out/share/mailpile"
+  '';
+
+  # No tests were found
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A modern, fast web-mail client with user-friendly encryption and privacy features";
+    homepage = "https://www.mailpile.is/";
+    license = [ licenses.asl20 licenses.agpl3 ];
+    platforms = platforms.linux;
+    maintainers = [ ];
+    knownVulnerabilities = [
+      "Numerous and uncounted, upstream has requested we not package it. See more: https://github.com/NixOS/nixpkgs/pull/23058#issuecomment-283515104"
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mailspring/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/mailspring/default.nix
new file mode 100644
index 000000000000..d2e5beb17180
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mailspring/default.nix
@@ -0,0 +1,95 @@
+{ stdenv
+, lib
+, fetchurl
+, autoPatchelfHook
+, alsa-lib
+, coreutils
+, db
+, dpkg
+, glib
+, gtk3
+, wrapGAppsHook
+, libkrb5
+, libsecret
+, nss
+, openssl
+, udev
+, xorg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mailspring";
+  version = "1.9.2";
+
+  src = fetchurl {
+    url = "https://github.com/Foundry376/Mailspring/releases/download/${version}/mailspring-${version}-amd64.deb";
+    sha256 = "sha256-o7w2XHd5FnPYt9j8IIGy6OgKtdeNb/qZ+EiXGEn0NUQ=";
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    dpkg
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    alsa-lib
+    db
+    glib
+    gtk3
+    libkrb5
+    libsecret
+    nss
+    xorg.libxkbfile
+    xorg.libXdamage
+    xorg.libXScrnSaver
+    xorg.libXtst
+  ];
+
+  runtimeDependencies = [
+    coreutils
+    openssl
+    (lib.getLib udev)
+  ];
+
+  unpackPhase = ''
+    runHook preUnpack
+
+    dpkg -x $src .
+
+    runHook postUnpack
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/{bin,lib}
+    cp -ar ./usr/share $out
+
+    substituteInPlace $out/share/mailspring/resources/app.asar.unpacked/mailsync \
+      --replace dirname ${coreutils}/bin/dirname
+
+    ln -s $out/share/mailspring/mailspring $out/bin/mailspring
+    ln -s ${openssl.out}/lib/libcrypto.so $out/lib/libcrypto.so.1.0.0
+
+    runHook postInstall
+  '';
+
+  postFixup = /* sh */ ''
+    substituteInPlace $out/share/applications/Mailspring.desktop \
+      --replace Exec=mailspring Exec=$out/bin/mailspring
+  '';
+
+  meta = with lib; {
+    description = "A beautiful, fast and maintained fork of Nylas Mail by one of the original authors";
+    longDescription = ''
+      Mailspring is an open-source mail client forked from Nylas Mail and built with Electron.
+      Mailspring's sync engine runs locally, but its source is not open.
+    '';
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ toschmidt doronbehar ];
+    homepage = "https://getmailspring.com";
+    downloadPage = "https://github.com/Foundry376/Mailspring";
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mblaze/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/mblaze/default.nix
new file mode 100644
index 000000000000..f24ed3a51df6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mblaze/default.nix
@@ -0,0 +1,54 @@
+{ coreutils, fetchFromGitHub, fetchpatch, file, gawk, gnugrep, gnused
+, installShellFiles, less, lib, libiconv, makeWrapper, nano, stdenv, ruby
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mblaze";
+  version = "1.1";
+
+  nativeBuildInputs = [ installShellFiles makeWrapper ];
+  buildInputs = [ ruby ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
+
+  src = fetchFromGitHub {
+    owner = "leahneukirchen";
+    repo = "mblaze";
+    rev = "v${version}";
+    sha256 = "sha256-Ho2Qoxs93ig4yYUOaoqdYnLA8Y4+7CfRM0dju89JOa4=";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    installShellCompletion contrib/_mblaze
+  '' + lib.optionalString (ruby != null) ''
+    install -Dt $out/bin contrib/msuck contrib/mblow
+
+    # The following wrappings are used to preserve the executable
+    # names (the value of $0 in a script). The script mcom is
+    # designed to be run directly or via symlinks such as mrep. Using
+    # symlinks changes the value of $0 in the script, and makes it
+    # behave differently. When using the wrapProgram tool, the resulting
+    # wrapper breaks this behaviour. The following wrappers preserve it.
+
+    mkdir -p $out/wrapped
+    for x in mcom mbnc mfwd mrep; do
+      mv $out/bin/$x $out/wrapped
+      makeWrapper $out/wrapped/$x $out/bin/$x \
+        --argv0 $out/bin/$x \
+        --prefix PATH : $out/bin \
+        --prefix PATH : ${lib.makeBinPath [
+          coreutils file gawk gnugrep gnused
+        ]}
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/leahneukirchen/mblaze";
+    description = "Unix utilities for processing and interacting with mail messages which are stored in maildir folders";
+    license = licenses.cc0;
+    platforms = platforms.all;
+    maintainers = [ maintainers.ajgrf ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/meli/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/meli/default.nix
new file mode 100644
index 000000000000..d0575b60653b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/meli/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, fetchgit
+, rustPlatform
+, pkg-config
+, openssl
+, dbus
+, sqlite
+, file
+, gzip
+, makeWrapper
+, notmuch
+  # Build with support for notmuch backend
+, withNotmuch ? true
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "meli";
+  version = "alpha-0.7.2";
+
+  src = fetchgit {
+    url = "https://git.meli.delivery/meli/meli.git";
+    rev = version;
+    sha256 = "sha256-cbigEJhX6vL+gHa40cxplmPsDhsqujkzQxe0Dr6+SK0=";
+  };
+
+  cargoSha256 = "sha256-ZE653OtXyZ9454bKPApmuL2kVko/hGBWEAya1L1KIoc=";
+
+  cargoBuildFlags = lib.optional withNotmuch "--features=notmuch";
+
+  nativeBuildInputs = [ pkg-config gzip makeWrapper ];
+
+  buildInputs = [ openssl dbus sqlite ] ++ lib.optional withNotmuch notmuch;
+
+  checkInputs = [ file ];
+
+  postInstall = ''
+    mkdir -p $out/share/man/man1
+    gzip < docs/meli.1 > $out/share/man/man1/meli.1.gz
+    mkdir -p $out/share/man/man5
+    gzip < docs/meli.conf.5 > $out/share/man/man5/meli.conf.5.gz
+    gzip < docs/meli-themes.5 > $out/share/man/man5/meli-themes.5.gz
+  '' + lib.optionalString withNotmuch ''
+    # Fixes this runtime error when meli is started with notmuch configured:
+    # $ meli
+    # libnotmuch5 was not found in your system. Make sure it is installed and
+    # in the library paths.
+    # notmuch is not a valid mail backend
+    wrapProgram $out/bin/meli --set LD_LIBRARY_PATH ${notmuch}/lib
+  '';
+
+  meta = with lib; {
+    description = "Experimental terminal mail client aiming for configurability and extensibility with sane defaults";
+    homepage = "https://meli.delivery";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ _0x4A6F matthiasbeyer erictapen ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mlarchive2maildir/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/mlarchive2maildir/default.nix
new file mode 100644
index 000000000000..a3a6051ef0c0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mlarchive2maildir/default.nix
@@ -0,0 +1,28 @@
+{ lib, python3, notmuch }:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "mlarchive2maildir";
+  version = "0.0.9";
+
+  src = python3.pkgs.fetchPypi {
+    inherit pname version;
+    sha256 = "02zjwa7zbcbqj76l0qmg7bbf3fqli60pl2apby3j4zwzcrrryczs";
+  };
+
+  nativeBuildInputs = with python3.pkgs; [ setuptools-scm ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    beautifulsoup4
+    click
+    click-log
+    requests
+    six
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/flokli/mlarchive2maildir";
+    description = "Imports mail from (pipermail) archives into a maildir";
+    license = licenses.mit;
+    maintainers = with maintainers; [ andir flokli ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mmh/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/mmh/default.nix
new file mode 100644
index 000000000000..fe74e922230d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mmh/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, ncurses, autoreconfHook, flex }:
+let rev = "431604647f89d5aac7b199a7883e98e56e4ccf9e";
+in stdenv.mkDerivation rec {
+  pname = "mmh";
+  version = "unstable-2019-09-08";
+
+  src = fetchurl {
+    url = "http://git.marmaro.de/?p=mmh;a=snapshot;h=${rev};sf=tgz";
+    name = "mmh-${rev}.tgz";
+    sha256 = "1q97p4g3f1q2m567i2dbx7mm7ixw3g91ww2rymwj42cxk9iyizhv";
+  };
+
+  postPatch = ''
+    substituteInPlace sbr/Makefile.in \
+      --replace "ar " "${stdenv.cc.targetPrefix}ar "
+ '';
+
+  buildInputs = [ ncurses ];
+  nativeBuildInputs = [ autoreconfHook flex ];
+
+  meta = with lib; {
+    description = "Set of electronic mail handling programs";
+    homepage = "http://marmaro.de/prog/mmh";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    broken = stdenv.isDarwin;
+    maintainers = with maintainers; [ kaction ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/msgviewer/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/msgviewer/default.nix
new file mode 100644
index 000000000000..5e9e17b47fd6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/msgviewer/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, makeWrapper, unzip, jre, runtimeShell }:
+
+stdenv.mkDerivation rec {
+  version = "1.9";
+  pname = "msgviewer";
+  uname = "MSGViewer";
+
+  src = fetchurl {
+    url    = "mirror://sourceforge/msgviewer/${uname}-${version}/${uname}-${version}.zip";
+    sha256 = "0igmr8c0757xsc94xlv2470zv2mz57zaj52dwr9wj8agmj23jbjz";
+  };
+
+  buildCommand = ''
+    dir=$out/lib/msgviewer
+    mkdir -p $out/bin $dir
+    unzip $src -d $dir
+    mv $dir/${uname}-${version}/* $dir
+    rmdir $dir/${uname}-${version}
+    cat <<_EOF > $out/bin/msgviewer
+    #!${runtimeShell} -eu
+    exec ${lib.getBin jre}/bin/java -jar $dir/MSGViewer.jar "\$@"
+    _EOF
+    chmod 755 $out/bin/msgviewer
+  '';
+
+  nativeBuildInputs = [ makeWrapper unzip ];
+
+  meta = with lib; {
+    description = "Viewer for .msg files (MS Outlook)";
+    homepage    = "https://www.washington.edu/alpine/";
+    license     = licenses.asl20;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/mutt/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/mutt/default.nix
new file mode 100644
index 000000000000..a94555e7959b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/mutt/default.nix
@@ -0,0 +1,96 @@
+{ lib, stdenv, fetchurl, fetchpatch, ncurses, which, perl
+, gdbm ? null
+, openssl ? null
+, cyrus_sasl ? null
+, gnupg ? null
+, gpgme ? null
+, libkrb5 ? null
+, headerCache  ? true
+, sslSupport   ? true
+, saslSupport  ? true
+, smimeSupport ? false
+, gpgSupport   ? false
+, gpgmeSupport ? true
+, imapSupport  ? true
+, withSidebar  ? true
+, gssSupport   ? true
+}:
+
+assert headerCache  -> gdbm       != null;
+assert sslSupport   -> openssl    != null;
+assert saslSupport  -> cyrus_sasl != null;
+assert smimeSupport -> openssl    != null;
+assert gpgSupport   -> gnupg      != null;
+assert gpgmeSupport -> gpgme      != null && openssl != null;
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "mutt";
+  version = "2.1.3";
+
+  src = fetchurl {
+    url = "http://ftp.mutt.org/pub/mutt/${pname}-${version}.tar.gz";
+    sha256 = "0z74slnq3y9wr1xr07jigz4n8dgxhk9qb0787sd0j6wj9g4rqxgg";
+  };
+
+  patches = optional smimeSupport (fetchpatch {
+    url = "https://salsa.debian.org/mutt-team/mutt/raw/debian/1.10.1-2/debian/patches/misc/smime.rc.patch";
+    sha256 = "0b4i00chvx6zj9pcb06x2jysmrcb2znn831lcy32cgfds6gr3nsi";
+  });
+
+  buildInputs =
+    [ ncurses which perl ]
+    ++ optional headerCache  gdbm
+    ++ optional sslSupport   openssl
+    ++ optional gssSupport   libkrb5
+    ++ optional saslSupport  cyrus_sasl
+    ++ optional gpgmeSupport gpgme;
+
+  configureFlags = [
+    (enableFeature headerCache  "hcache")
+    (enableFeature gpgmeSupport "gpgme")
+    (enableFeature imapSupport  "imap")
+    (enableFeature withSidebar  "sidebar")
+    "--enable-smtp"
+    "--enable-pop"
+    "--with-mailpath="
+
+    # Look in $PATH at runtime, instead of hardcoding /usr/bin/sendmail
+    "ac_cv_path_SENDMAIL=sendmail"
+
+    # This allows calls with "-d N", that output debug info into ~/.muttdebug*
+    "--enable-debug"
+
+    # The next allows building mutt without having anything setgid
+    # set by the installer, and removing the need for the group 'mail'
+    # I set the value 'mailbox' because it is a default in the configure script
+    "--with-homespool=mailbox"
+  ] ++ optional sslSupport  "--with-ssl"
+    ++ optional gssSupport  "--with-gss"
+    ++ optional saslSupport "--with-sasl";
+
+  postPatch = optionalString (smimeSupport || gpgmeSupport) ''
+    sed -i 's#/usr/bin/openssl#${openssl}/bin/openssl#' smime_keys.pl
+  '';
+
+  postInstall = optionalString smimeSupport ''
+    # S/MIME setup
+    cp contrib/smime.rc $out/etc/smime.rc
+    sed -i 's#openssl#${openssl}/bin/openssl#' $out/etc/smime.rc
+    echo "source $out/etc/smime.rc" >> $out/etc/Muttrc
+  '' + optionalString gpgSupport ''
+    # GnuPG setup
+    cp contrib/gpg.rc $out/etc/gpg.rc
+    sed -i 's#\(command="\)gpg #\1${gnupg}/bin/gpg #' $out/etc/gpg.rc
+    echo "source $out/etc/gpg.rc" >> $out/etc/Muttrc
+  '';
+
+  meta = {
+    description = "A small but very powerful text-based mail client";
+    homepage = "http://www.mutt.org";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ rnhmjoj ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/neomutt/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/neomutt/default.nix
new file mode 100644
index 000000000000..23b636458c9b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/neomutt/default.nix
@@ -0,0 +1,102 @@
+{ lib, stdenv, fetchFromGitHub, gettext, makeWrapper, tcl, which
+, ncurses, perl , cyrus_sasl, gss, gpgme, libkrb5, libidn, libxml2, notmuch, openssl
+, lmdb, libxslt, docbook_xsl, docbook_xml_dtd_42, w3m, mailcap, sqlite, zlib
+}:
+
+stdenv.mkDerivation rec {
+  version = "20211015";
+  pname = "neomutt";
+
+  src = fetchFromGitHub {
+    owner  = "neomutt";
+    repo   = "neomutt";
+    rev    = version;
+    sha256 = "sha256-ObYeh9Q/WZ1N60pxR2LoDNCU8rP4tQt/oIxnqALqMhs=";
+  };
+
+  buildInputs = [
+    cyrus_sasl gss gpgme libkrb5 libidn ncurses
+    notmuch openssl perl lmdb
+    mailcap sqlite
+  ];
+
+  nativeBuildInputs = [
+    docbook_xsl docbook_xml_dtd_42 gettext libxml2 libxslt.bin makeWrapper tcl which zlib w3m
+  ];
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    substituteInPlace contrib/smime_keys \
+      --replace /usr/bin/openssl ${openssl}/bin/openssl
+
+    for f in doc/*.{xml,xsl}*  ; do
+      substituteInPlace $f \
+        --replace http://docbook.sourceforge.net/release/xsl/current     ${docbook_xsl}/share/xml/docbook-xsl \
+        --replace http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd ${docbook_xml_dtd_42}/xml/dtd/docbook/docbookx.dtd
+    done
+
+
+    # allow neomutt to map attachments to their proper mime.types if specified wrongly
+    # and use a far more comprehensive list than the one shipped with neomutt
+    substituteInPlace send/sendlib.c \
+      --replace /etc/mime.types ${mailcap}/etc/mime.types
+  '';
+
+  preBuild = ''
+    export HOME=$(mktemp -d)
+  '';
+
+  configureFlags = [
+    "--enable-autocrypt"
+    "--gpgme"
+    "--gss"
+    "--lmdb"
+    "--notmuch"
+    "--ssl"
+    "--sasl"
+    "--with-homespool=mailbox"
+    "--with-mailpath="
+    # To make it not reference .dev outputs. See:
+    # https://github.com/neomutt/neomutt/pull/2367
+    "--disable-include-path-in-cflags"
+    # Look in $PATH at runtime, instead of hardcoding /usr/bin/sendmail
+    "ac_cv_path_SENDMAIL=sendmail"
+    "--zlib"
+  ];
+
+  # Fix missing libidn in mutt;
+  # this fix is ugly since it links all binaries in mutt against libidn
+  # like pgpring, pgpewrap, ...
+  NIX_LDFLAGS = "-lidn";
+
+  postInstall = ''
+    wrapProgram "$out/bin/neomutt" --prefix PATH : "$out/libexec/neomutt"
+  '';
+
+  doCheck = true;
+
+  preCheck = ''
+    cp -r ${fetchFromGitHub {
+      owner = "neomutt";
+      repo = "neomutt-test-files";
+      rev = "8629adab700a75c54e8e28bf05ad092503a98f75";
+      sha256 = "1ci04nqkab9mh60zzm66sd6mhsr6lya8wp92njpbvafc86vvwdlr";
+    }} $(pwd)/test-files
+    chmod -R +w test-files
+    (cd test-files && ./setup.sh)
+
+    export NEOMUTT_TEST_DIR=$(pwd)/test-files
+  '';
+
+  checkTarget = "test";
+  postCheck = "unset NEOMUTT_TEST_DIR";
+
+  meta = with lib; {
+    description = "A small but very powerful text-based mail client";
+    homepage    = "http://www.neomutt.org";
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ cstrahan erikryb jfrankenau vrthra ma27 ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/notbit/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/notbit/default.nix
new file mode 100644
index 000000000000..5c979bde6040
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/notbit/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config,
+  gettext, openssl
+}:
+
+with lib;
+
+stdenv.mkDerivation {
+  pname = "notbit";
+  version = "2018-01-09";
+
+  src = fetchFromGitHub {
+    owner  = "bpeel";
+    repo   = "notbit";
+    rev    = "8b5d3d2da8ce54abae2536b4d97641d2c798cff3";
+    sha256 = "1623n0lvx42mamvb2vwin5i38hh0nxpxzmkr5188ss2x7m20lmii";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ openssl gettext ];
+
+  meta = {
+    description = "A minimal Bitmessage client";
+    homepage = "https://github.com/bpeel/notbit";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ mog ];
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix
new file mode 100644
index 000000000000..64ebb78a12d0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch-addrlookup/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, glib, notmuch }:
+
+let
+  version = "9";
+in
+stdenv.mkDerivation {
+  pname = "notmuch-addrlookup";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "aperezdc";
+    repo = "notmuch-addrlookup-c";
+    rev ="v${version}";
+    sha256 = "1j3zdx161i1x4w0nic14ix5i8hd501rb31daf8api0k8855sx4rc";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib notmuch ];
+
+  installPhase = "install -D notmuch-addrlookup $out/bin/notmuch-addrlookup";
+
+  meta = with lib; {
+    description = "Address lookup tool for Notmuch in C";
+    homepage = "https://github.com/aperezdc/notmuch-addrlookup-c";
+    maintainers = with maintainers; [ mog ];
+    platforms = platforms.unix;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/notmuch-bower/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch-bower/default.nix
new file mode 100644
index 000000000000..feca7bd20182
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch-bower/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, gawk, mercury, pandoc, ncurses, gpgme }:
+
+stdenv.mkDerivation rec {
+  pname = "notmuch-bower";
+  version = "0.13";
+
+  src = fetchFromGitHub {
+    owner = "wangp";
+    repo = "bower";
+    rev = version;
+    sha256 = "0r5s16pc3ym5nd33lv9ljv1p1gpb7yysrdni4g7w7yvjrnwk35l6";
+  };
+
+  nativeBuildInputs = [ gawk mercury pandoc ];
+
+  buildInputs = [ ncurses gpgme ];
+
+  makeFlags = [ "PARALLEL=-j$(NIX_BUILD_CORES)" "bower" "man" ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    mv bower $out/bin/
+    mkdir -p $out/share/man/man1
+    mv bower.1 $out/share/man/man1/
+    runHook postInstall
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/wangp/bower";
+    description = "A curses terminal client for the Notmuch email system";
+    maintainers = with maintainers; [ jgart ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/notmuch/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch/default.nix
new file mode 100644
index 000000000000..5e6dc6c6bb65
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch/default.nix
@@ -0,0 +1,99 @@
+{ fetchurl, lib, stdenv
+, pkg-config, gnupg
+, xapian, gmime, talloc, zlib
+, doxygen, perl, texinfo
+, pythonPackages
+, emacs
+, ruby
+, which, dtach, openssl, bash, gdb, man
+, withEmacs ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "notmuch";
+  version = "0.33.2";
+
+  src = fetchurl {
+    url = "https://notmuchmail.org/releases/notmuch-${version}.tar.xz";
+    hash = "sha256:1bic1f2va136aygfy53bsgziwiidcpb7qf1v05mlza2jmgv94j14";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    doxygen                   # (optional) api docs
+    pythonPackages.sphinx     # (optional) documentation -> doc/INSTALL
+    texinfo                   # (optional) documentation -> doc/INSTALL
+    pythonPackages.cffi
+  ] ++ lib.optional withEmacs emacs;
+
+  buildInputs = [
+    gnupg                     # undefined dependencies
+    xapian gmime talloc zlib  # dependencies described in INSTALL
+    perl
+    pythonPackages.python
+    ruby
+  ];
+
+  postPatch = ''
+    patchShebangs configure test/
+
+    substituteInPlace lib/Makefile.local \
+      --replace '-install_name $(libdir)' "-install_name $out/lib"
+  '' + lib.optionalString withEmacs ''
+    substituteInPlace emacs/notmuch-emacs-mua \
+      --replace 'EMACS:-emacs' 'EMACS:-${emacs}/bin/emacs' \
+      --replace 'EMACSCLIENT:-emacsclient' 'EMACSCLIENT:-${emacs}/bin/emacsclient'
+  '';
+
+  configureFlags = [
+    "--zshcompletiondir=${placeholder "out"}/share/zsh/site-functions"
+    "--bashcompletiondir=${placeholder "out"}/share/bash-completion/completions"
+    "--infodir=${placeholder "info"}/share/info"
+  ] ++ lib.optional (!withEmacs) "--without-emacs"
+    ++ lib.optional withEmacs "--emacslispdir=${placeholder "emacs"}/share/emacs/site-lisp"
+    ++ lib.optional (isNull ruby) "--without-ruby";
+
+  # Notmuch doesn't use autoconf and consequently doesn't tag --bindir and
+  # friends
+  setOutputFlags = false;
+  enableParallelBuilding = true;
+  makeFlags = [ "V=1" ];
+
+  outputs = [ "out" "man" "info" ] ++ lib.optional withEmacs "emacs";
+
+  preCheck = let
+    test-database = fetchurl {
+      url = "https://notmuchmail.org/releases/test-databases/database-v1.tar.xz";
+      sha256 = "1lk91s00y4qy4pjh8638b5lfkgwyl282g1m27srsf7qfn58y16a2";
+    };
+  in ''
+    mkdir -p test/test-databases
+    ln -s ${test-database} test/test-databases/database-v1.tar.xz
+  '';
+
+  doCheck = !stdenv.hostPlatform.isDarwin && (lib.versionAtLeast gmime.version "3.0.3");
+  checkTarget = "test";
+  checkInputs = [
+    which dtach openssl bash
+    gdb man emacs
+  ];
+
+  installTargets = [ "install" "install-man" "install-info" ];
+
+  postInstall = lib.optionalString withEmacs ''
+    moveToOutput bin/notmuch-emacs-mua $emacs
+  '';
+
+  passthru = {
+    pythonSourceRoot = "notmuch-${version}/bindings/python";
+    inherit version;
+  };
+
+  meta = with lib; {
+    description = "Mail indexer";
+    homepage    = "https://notmuchmail.org/";
+    license     = licenses.gpl3Plus;
+    maintainers = with maintainers; [ flokli puckipedia ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/notmuch/muchsync.nix b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch/muchsync.nix
new file mode 100644
index 000000000000..fc8c83f216cb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch/muchsync.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl
+, notmuch, openssl, pkg-config, sqlite, xapian, zlib
+}:
+stdenv.mkDerivation rec {
+  version = "5";
+  pname = "muchsync";
+  passthru = {
+    inherit version;
+  };
+  src = fetchurl {
+    url = "http://www.muchsync.org/src/${pname}-${version}.tar.gz";
+    sha256 = "1k2m44pj5i6vfhp9icdqs42chsp208llanc666p3d9nww8ngq2lb";
+  };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ notmuch openssl sqlite xapian zlib ];
+  meta = {
+    description = "Synchronize maildirs and notmuch databases";
+    homepage = "http://www.muchsync.org/";
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [];
+    license = lib.licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/notmuch/mutt.nix b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch/mutt.nix
new file mode 100644
index 000000000000..ffd30c754b47
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/notmuch/mutt.nix
@@ -0,0 +1,46 @@
+{ stdenv, lib, perl, perlPackages, makeWrapper, coreutils, notmuch }:
+
+stdenv.mkDerivation rec {
+  pname = "notmuch-mutt";
+  version = notmuch.version;
+
+  outputs = [ "out" ];
+
+  dontStrip = true;
+
+  buildInputs = [
+    perl
+    makeWrapper
+  ] ++ (with perlPackages; [
+    FileRemove
+    DigestSHA1
+    Later
+    MailBox
+    MailMaildir
+    MailTools
+    StringShellQuote
+    TermReadLineGnu
+  ]);
+
+  src = notmuch.src;
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    ${coreutils}/bin/install -Dm755 \
+      ./contrib/notmuch-mutt/notmuch-mutt \
+      $out/bin/notmuch-mutt
+
+    wrapProgram $out/bin/notmuch-mutt \
+      --prefix PERL5LIB : $PERL5LIB
+  '';
+
+  meta = with lib; {
+    description = "Mutt support for notmuch";
+    homepage    = "https://notmuchmail.org/";
+    license     = with licenses; gpl3;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/sylpheed/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/sylpheed/default.nix
new file mode 100644
index 000000000000..9a65bec21c20
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/sylpheed/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, pkg-config, gtk2, openssl ? null, gpgme ? null
+, gpgSupport ? true, sslSupport ? true, fetchpatch }:
+
+assert gpgSupport -> gpgme != null;
+assert sslSupport -> openssl != null;
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "sylpheed";
+  version = "3.7.0";
+
+  src = fetchurl {
+    url = "https://sylpheed.sraoss.jp/sylpheed/v3.7/${pname}-${version}.tar.xz";
+    sha256 = "0j9y5vdzch251s264diw9clrn88dn20bqqkwfmis9l7m8vmwasqd";
+  };
+
+  patches = [
+    (fetchpatch {
+      # patch upstream bug https://sylpheed.sraoss.jp/redmine/issues/306
+      name = "patch-libsylph_ssl_c.patch";
+      url = "https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/mail/sylpheed/patches/patch-libsylph_ssl_c?rev=1.4&content-type=text/plain";
+      sha256 = "sha256-k9OwPtHrEjaxXdH0trNqXgJMhR8kjgtei9pi6OFvILk=";
+    })
+  ];
+
+  patchFlags = [ "-p0" ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ gtk2 ]
+    ++ optionals gpgSupport [ gpgme ]
+    ++ optionals sslSupport [ openssl ];
+
+  configureFlags = optional gpgSupport "--enable-gpgme"
+    ++ optional sslSupport "--enable-ssl";
+
+  meta = {
+    homepage = "https://sylpheed.sraoss.jp/en/";
+    description = "Lightweight and user-friendly e-mail client";
+    maintainers = with maintainers; [ eelco ];
+    platforms = platforms.linux ++ platforms.darwin;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
new file mode 100644
index 000000000000..6d9f62e75ab3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
@@ -0,0 +1,193 @@
+# Update instructions:
+#
+# To update `thunderbird-bin`'s `release_sources.nix`, run from the nixpkgs root:
+#
+#     nix-shell maintainers/scripts/update.nix --argstr package pkgs.firefox-bin-unwrapped
+{ stdenv, lib, fetchurl, config, makeWrapper
+, alsa-lib
+, at-spi2-atk
+, atk
+, cairo
+, coreutils
+, cups
+, curl
+, dbus
+, dbus-glib
+, fontconfig
+, freetype
+, gdk-pixbuf
+, glib
+, glibc
+, gnome
+, gnugrep
+, gnupg
+, gnused
+, gpgme
+, gtk2
+, gtk3
+, libkrb5
+, libcanberra
+, libGL
+, libGLU
+, libX11
+, libxcb
+, libXcomposite
+, libXcursor
+, libXdamage
+, libXext
+, libXfixes
+, libXi
+, libXinerama
+, libXrender
+, libXScrnSaver
+, libXt
+, nspr
+, nss
+, pango
+, runtimeShell
+, writeScript
+, xdg-utils
+, xidel
+}:
+
+# imports `version` and `sources`
+with (import ./release_sources.nix);
+
+let
+  arch = if stdenv.hostPlatform.system == "i686-linux"
+    then "linux-i686"
+    else "linux-x86_64";
+
+  isPrefixOf = prefix: string:
+    builtins.substring 0 (builtins.stringLength prefix) string == prefix;
+
+  sourceMatches = locale: source:
+      (isPrefixOf source.locale locale) && source.arch == arch;
+
+  systemLocale = config.i18n.defaultLocale or "en-US";
+
+  defaultSource = lib.findFirst (sourceMatches "en-US") {} sources;
+
+  source = lib.findFirst (sourceMatches systemLocale) defaultSource sources;
+in
+
+stdenv.mkDerivation {
+  pname = "thunderbird-bin";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://download-installer.cdn.mozilla.net/pub/thunderbird/releases/${version}/${source.arch}/${source.locale}/thunderbird-${version}.tar.bz2";
+    inherit (source) sha256;
+  };
+
+  libPath = lib.makeLibraryPath
+    [ stdenv.cc.cc
+      alsa-lib
+      at-spi2-atk
+      atk
+      cairo
+      cups
+      curl
+      dbus-glib
+      dbus
+      fontconfig
+      freetype
+      gdk-pixbuf
+      glib
+      glibc
+      gtk2
+      gtk3
+      libkrb5
+      libX11
+      libXScrnSaver
+      libXcomposite
+      libXcursor
+      libXdamage
+      libXext
+      libXfixes
+      libXi
+      libXinerama
+      libXrender
+      libXt
+      libxcb
+      libcanberra
+      libGLU libGL
+      nspr
+      nss
+      pango
+    ] + ":" + lib.makeSearchPathOutput "lib" "lib64" [
+      stdenv.cc.cc
+    ];
+
+  buildInputs = [ gtk3 gnome.adwaita-icon-theme ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  # See "Note on GPG support" in `../thunderbird/default.nix` for explanations
+  # on adding `gnupg` and `gpgme` into PATH/LD_LIBRARY_PATH.
+
+  installPhase =
+    ''
+      mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}"
+      cp -r * "$prefix/usr/lib/thunderbird-bin-${version}"
+
+      mkdir -p "$out/bin"
+      ln -s "$prefix/usr/lib/thunderbird-bin-${version}/thunderbird" "$out/bin/"
+
+      for executable in \
+        thunderbird crashreporter thunderbird-bin plugin-container updater
+      do
+        patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+          "$out/usr/lib/thunderbird-bin-${version}/$executable"
+      done
+
+      find . -executable -type f -exec \
+        patchelf --set-rpath "$libPath" \
+          "$out/usr/lib/thunderbird-bin-${version}/{}" \;
+
+      # Create a desktop item.
+      mkdir -p $out/share/applications
+      cat > $out/share/applications/thunderbird.desktop <<EOF
+      [Desktop Entry]
+      Type=Application
+      Exec=$out/bin/thunderbird
+      Icon=$out/usr/lib/thunderbird-bin-${version}/chrome/icons/default/default256.png
+      Name=Thunderbird
+      GenericName=Mail Reader
+      Categories=Application;Network;
+      EOF
+
+      # SNAP_NAME: https://github.com/NixOS/nixpkgs/pull/61980
+      # MOZ_LEGACY_PROFILES and MOZ_ALLOW_DOWNGRADE:
+      #   commit 87e261843c4236c541ee0113988286f77d2fa1ee
+      wrapProgram "$out/bin/thunderbird" \
+        --argv0 "$out/bin/.thunderbird-wrapped" \
+        --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:" \
+        --suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS" \
+        --set SNAP_NAME "thunderbird" \
+        --set MOZ_LEGACY_PROFILES 1 \
+        --set MOZ_ALLOW_DOWNGRADE 1 \
+        --prefix PATH : "${lib.getBin gnupg}/bin" \
+        --prefix PATH : "${lib.getBin xdg-utils}/bin" \
+        --prefix LD_LIBRARY_PATH : "${lib.getLib gpgme}/lib"
+    '';
+
+  passthru.updateScript = import ./../../browsers/firefox-bin/update.nix {
+    inherit writeScript xidel coreutils gnused gnugrep curl gnupg runtimeShell;
+    pname = "thunderbird-bin";
+    baseName = "thunderbird";
+    channel = "release";
+    basePath = "pkgs/applications/networking/mailreaders/thunderbird-bin";
+    baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/";
+  };
+  meta = with lib; {
+    description = "Mozilla Thunderbird, a full-featured email client (binary package)";
+    homepage = "http://www.mozilla.org/thunderbird/";
+    license = {
+      free = false;
+      url = "http://www.mozilla.org/en-US/foundation/trademarks/policy/";
+    };
+    maintainers = with lib.maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird-bin/release_sources.nix b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird-bin/release_sources.nix
new file mode 100644
index 000000000000..1cdce2638beb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird-bin/release_sources.nix
@@ -0,0 +1,655 @@
+{
+  version = "91.1.2";
+  sources = [
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/af/thunderbird-91.1.2.tar.bz2";
+      locale = "af";
+      arch = "linux-x86_64";
+      sha256 = "f786ba47061600b2a4fce6dc537e4d5f41ef7e496ddd24e06e5cf2d2bc7ae615";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ar/thunderbird-91.1.2.tar.bz2";
+      locale = "ar";
+      arch = "linux-x86_64";
+      sha256 = "70e13fa57939ec35fed7e537c282411e022e2e596af298ff68ed06d29149ad44";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ast/thunderbird-91.1.2.tar.bz2";
+      locale = "ast";
+      arch = "linux-x86_64";
+      sha256 = "22ac54e15cc8d89412f26906b10d7274a90d86f298948998dabbbb63000fd9bd";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/be/thunderbird-91.1.2.tar.bz2";
+      locale = "be";
+      arch = "linux-x86_64";
+      sha256 = "bb59b38220fc5a2e429df9bf521610678b7b3c7e47e4a3208c9e0e54860ae098";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/bg/thunderbird-91.1.2.tar.bz2";
+      locale = "bg";
+      arch = "linux-x86_64";
+      sha256 = "7a0d50876f51664074b6eefd20dc727cea2d4a0feceb721c63fa9e3872ea6d07";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/br/thunderbird-91.1.2.tar.bz2";
+      locale = "br";
+      arch = "linux-x86_64";
+      sha256 = "8a49fe9b26d1a5c5b3c28209cbb6d81e785235f4e1b24e4638cf5a5fa720d68e";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ca/thunderbird-91.1.2.tar.bz2";
+      locale = "ca";
+      arch = "linux-x86_64";
+      sha256 = "380d655a39c7f20067045cf2ec75e5bca0ba0e8291d187fd87ac42abbbce7dc7";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/cak/thunderbird-91.1.2.tar.bz2";
+      locale = "cak";
+      arch = "linux-x86_64";
+      sha256 = "ff12816d6dac6311b2f0a358ee4a30e80d3a346c9a2fc08c9c4d72b2e7421b03";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/cs/thunderbird-91.1.2.tar.bz2";
+      locale = "cs";
+      arch = "linux-x86_64";
+      sha256 = "fc8ed1c83b76329aecd9b6b7b4c2278b2703dc267ef25ad973deefff01cbb29d";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/cy/thunderbird-91.1.2.tar.bz2";
+      locale = "cy";
+      arch = "linux-x86_64";
+      sha256 = "50e10c11f341b75e4ca464911a7229d22073d72b53731ba92cbd39c52694e0d2";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/da/thunderbird-91.1.2.tar.bz2";
+      locale = "da";
+      arch = "linux-x86_64";
+      sha256 = "1c041fb7c71e9d0f07c82652129a6b48f2f633a7781c41a3c439dec1d7fcabee";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/de/thunderbird-91.1.2.tar.bz2";
+      locale = "de";
+      arch = "linux-x86_64";
+      sha256 = "c9ed27ee3f1a631c6a7d7a5a854e48f3285b9f01c81bc9ee3611bbdd9f483cdc";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/dsb/thunderbird-91.1.2.tar.bz2";
+      locale = "dsb";
+      arch = "linux-x86_64";
+      sha256 = "3c00604247dee961915f2aff628bd7d1f53c4f7e48bb848ef6065e41f189495d";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/el/thunderbird-91.1.2.tar.bz2";
+      locale = "el";
+      arch = "linux-x86_64";
+      sha256 = "b9ad1ab6b7d33f477f51e4337d914f8f8d2f6d7bc1b3b884d8b71b17547c3fa0";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/en-CA/thunderbird-91.1.2.tar.bz2";
+      locale = "en-CA";
+      arch = "linux-x86_64";
+      sha256 = "80e6b5785d334bec69455ca5f5039bbd4fbebd663ea91d17d0fbe8e33d747670";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/en-GB/thunderbird-91.1.2.tar.bz2";
+      locale = "en-GB";
+      arch = "linux-x86_64";
+      sha256 = "da2388577784df3faad7b40566e2e1eab2b95dd9455a1e4e3ee43433f4fb189e";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/en-US/thunderbird-91.1.2.tar.bz2";
+      locale = "en-US";
+      arch = "linux-x86_64";
+      sha256 = "1354e3ad2989749fe79b404ccae3002de8b4e269c98388d9abebe456f3de47d2";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/es-AR/thunderbird-91.1.2.tar.bz2";
+      locale = "es-AR";
+      arch = "linux-x86_64";
+      sha256 = "f51d4a1109d30d4857673575aef173026e2c90fc7ece6835a34a0e792672cf8b";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/es-ES/thunderbird-91.1.2.tar.bz2";
+      locale = "es-ES";
+      arch = "linux-x86_64";
+      sha256 = "38196b265eeaef2222e624e2fb0cb7742b2171965aa0725b3d524e9199ea4f91";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/et/thunderbird-91.1.2.tar.bz2";
+      locale = "et";
+      arch = "linux-x86_64";
+      sha256 = "ab3b04c02b730f92db4f24daac688e1966349cf4c978ed06138285fcb2d72769";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/eu/thunderbird-91.1.2.tar.bz2";
+      locale = "eu";
+      arch = "linux-x86_64";
+      sha256 = "4431e16f70b6182b1ec2bed64d149ffc7e46f1b2536268e973eb984439eda400";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/fi/thunderbird-91.1.2.tar.bz2";
+      locale = "fi";
+      arch = "linux-x86_64";
+      sha256 = "8ee9b2983d1f214f4589d7d99d1ac1a577f92dd3cc73f516dcc050079ed85904";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/fr/thunderbird-91.1.2.tar.bz2";
+      locale = "fr";
+      arch = "linux-x86_64";
+      sha256 = "b614dadf34774ebf45c88ae0c72c6d8779beb8310a8353aedeca1a493178c376";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/fy-NL/thunderbird-91.1.2.tar.bz2";
+      locale = "fy-NL";
+      arch = "linux-x86_64";
+      sha256 = "00693bbfda9377d2695fc8c7c242b0e4a3c1b745e8779ebabe5686eca4fc928a";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ga-IE/thunderbird-91.1.2.tar.bz2";
+      locale = "ga-IE";
+      arch = "linux-x86_64";
+      sha256 = "00d26b39726e2de2e799b3dff97c79a590f712f3347232600d1f2771523d0ab4";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/gd/thunderbird-91.1.2.tar.bz2";
+      locale = "gd";
+      arch = "linux-x86_64";
+      sha256 = "d9a35fbf9f4069c6f4dd796c8f9465053413d806093d1456e643c9bdb081ad45";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/gl/thunderbird-91.1.2.tar.bz2";
+      locale = "gl";
+      arch = "linux-x86_64";
+      sha256 = "9e7f237b55f81a44a984be4b4e1001c8ffd7742eb14e654397e80b4e4b765d0c";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/he/thunderbird-91.1.2.tar.bz2";
+      locale = "he";
+      arch = "linux-x86_64";
+      sha256 = "b86d479dd64ac86d43fbfb54c8ec36ea6b4516ded0383f81b78c11365290f21b";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/hr/thunderbird-91.1.2.tar.bz2";
+      locale = "hr";
+      arch = "linux-x86_64";
+      sha256 = "cb7e8d0dd04c5883f2ec0f47d81a751b901e0036f151ab1c0f3043ba7ebf4a74";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/hsb/thunderbird-91.1.2.tar.bz2";
+      locale = "hsb";
+      arch = "linux-x86_64";
+      sha256 = "d3141a413d82814067de2791091473e0b44f8939825cc3071b1fbe86e08dd49a";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/hu/thunderbird-91.1.2.tar.bz2";
+      locale = "hu";
+      arch = "linux-x86_64";
+      sha256 = "b76860152f68b2dfabef9847c83356af34b8fb1913d0d55a397be3d4e4e08b31";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/hy-AM/thunderbird-91.1.2.tar.bz2";
+      locale = "hy-AM";
+      arch = "linux-x86_64";
+      sha256 = "5aa35ed5d577befb7a37d5407bc7ff78c54314a7e5ed77bda588bd74111e263b";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/id/thunderbird-91.1.2.tar.bz2";
+      locale = "id";
+      arch = "linux-x86_64";
+      sha256 = "0bb53b2cbed8a9412c6776435381d5c859a9993b4bd2cdf5ecd4145d13776d09";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/is/thunderbird-91.1.2.tar.bz2";
+      locale = "is";
+      arch = "linux-x86_64";
+      sha256 = "566058b39d98a777cb1c333b66cac66851d0c369918e58c592b8e0151b778f6f";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/it/thunderbird-91.1.2.tar.bz2";
+      locale = "it";
+      arch = "linux-x86_64";
+      sha256 = "b88fb1b473a7b0b1a4af08a09aadf5b7502f03462a1f4661ed2897c2705e5b4d";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ja/thunderbird-91.1.2.tar.bz2";
+      locale = "ja";
+      arch = "linux-x86_64";
+      sha256 = "6b69cd834280b36182656bd97b117c3f70bbcd947ab25e1936294a85149d3501";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ka/thunderbird-91.1.2.tar.bz2";
+      locale = "ka";
+      arch = "linux-x86_64";
+      sha256 = "87d8bc04c278d8c675665d0211917a854d43a17d24173627703268a785ff2206";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/kab/thunderbird-91.1.2.tar.bz2";
+      locale = "kab";
+      arch = "linux-x86_64";
+      sha256 = "fad11f653198314683faaa758422506d27706b6dca90a4d5b0d3693810843fba";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/kk/thunderbird-91.1.2.tar.bz2";
+      locale = "kk";
+      arch = "linux-x86_64";
+      sha256 = "67469c2c4e1352db94339687f93c0afefe41244bfc952d77c2e41e31a652f095";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ko/thunderbird-91.1.2.tar.bz2";
+      locale = "ko";
+      arch = "linux-x86_64";
+      sha256 = "93bb5a6973bbd0eaac721ffd59c19edce400471c08d76aa629b2fe66fc98ddf9";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/lt/thunderbird-91.1.2.tar.bz2";
+      locale = "lt";
+      arch = "linux-x86_64";
+      sha256 = "f4dda73c80cee8aaceee0f4ea0956303f9a50aa2431c6eb8a34d7d22b5fe53e9";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/lv/thunderbird-91.1.2.tar.bz2";
+      locale = "lv";
+      arch = "linux-x86_64";
+      sha256 = "65325a804f5aec439501bd70e5423d56ddc5a10636b639e8db85ce8881c1586e";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ms/thunderbird-91.1.2.tar.bz2";
+      locale = "ms";
+      arch = "linux-x86_64";
+      sha256 = "f2715978bc8e2d7878f8ec47b4a29cccaa42a24bd97f013f6b66aaf47db83359";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/nb-NO/thunderbird-91.1.2.tar.bz2";
+      locale = "nb-NO";
+      arch = "linux-x86_64";
+      sha256 = "c252fdee3a9d9c43b46786c528bb8ac39203b7d7c746f9c9f04287cb1253ded6";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/nl/thunderbird-91.1.2.tar.bz2";
+      locale = "nl";
+      arch = "linux-x86_64";
+      sha256 = "1708531ca0b765292206fa9c533200266f5eb48fbbc74daade404bdcbfdcc750";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/nn-NO/thunderbird-91.1.2.tar.bz2";
+      locale = "nn-NO";
+      arch = "linux-x86_64";
+      sha256 = "dc26c1333787accc73624bc5bac820af1743ea30d85e9da9a0c30f6b9b0c3bcf";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/pa-IN/thunderbird-91.1.2.tar.bz2";
+      locale = "pa-IN";
+      arch = "linux-x86_64";
+      sha256 = "fc508dd719c18c250560b5d4fc4672ce83a9f52b6103d3f33034eca89ed2935f";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/pl/thunderbird-91.1.2.tar.bz2";
+      locale = "pl";
+      arch = "linux-x86_64";
+      sha256 = "eb54040a841d0da1e84dd2a6ba3c894a57d40fdb0bf99f21b7fbbe3ea8cd755c";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/pt-BR/thunderbird-91.1.2.tar.bz2";
+      locale = "pt-BR";
+      arch = "linux-x86_64";
+      sha256 = "45226857a691f8568c769f652820eb5b86b0928c271b2751014bd6e7ab29ab80";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/pt-PT/thunderbird-91.1.2.tar.bz2";
+      locale = "pt-PT";
+      arch = "linux-x86_64";
+      sha256 = "532f18bbe7fc09793bd688e5bc48c65658e2a48285b97c611b68611e9f13257d";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/rm/thunderbird-91.1.2.tar.bz2";
+      locale = "rm";
+      arch = "linux-x86_64";
+      sha256 = "8d0f2ec43e6e00118d7c1d5877bfbc5b5c87a8e449a0358acc6e71244a0716b3";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ro/thunderbird-91.1.2.tar.bz2";
+      locale = "ro";
+      arch = "linux-x86_64";
+      sha256 = "dbfd5500b337132ab14266d2b87224c917086afe3f210127d73848d360299241";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/ru/thunderbird-91.1.2.tar.bz2";
+      locale = "ru";
+      arch = "linux-x86_64";
+      sha256 = "06f6077ba98fc2605718266e57b9c5c54c3d7901f2b7233f38d7fd02d6d063a0";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/sk/thunderbird-91.1.2.tar.bz2";
+      locale = "sk";
+      arch = "linux-x86_64";
+      sha256 = "af1224613b3e962265d83b154cbf69053906197f2b7f12e5004ad862bef09aaa";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/sl/thunderbird-91.1.2.tar.bz2";
+      locale = "sl";
+      arch = "linux-x86_64";
+      sha256 = "597cd2732960eadd0121c4089a703cc86a0d9a361ff024fe047c8c624dc05afc";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/sq/thunderbird-91.1.2.tar.bz2";
+      locale = "sq";
+      arch = "linux-x86_64";
+      sha256 = "c107fb5653cb7adfa79aad501e585943159fa9297ef360b193075a9b49e91d54";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/sr/thunderbird-91.1.2.tar.bz2";
+      locale = "sr";
+      arch = "linux-x86_64";
+      sha256 = "33964cc6308a8e7ebc154c057f90729a92d2a9127f9d8c4592f884531d094334";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/sv-SE/thunderbird-91.1.2.tar.bz2";
+      locale = "sv-SE";
+      arch = "linux-x86_64";
+      sha256 = "91fa282c3baee03653ffe5164844e06a9813a40c360ef24e94ff525638f187de";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/th/thunderbird-91.1.2.tar.bz2";
+      locale = "th";
+      arch = "linux-x86_64";
+      sha256 = "99ea8b61e102c3394073f3a817d3eeddc3cedb51436b66303730394f362e91f7";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/tr/thunderbird-91.1.2.tar.bz2";
+      locale = "tr";
+      arch = "linux-x86_64";
+      sha256 = "bb1d417239c31c6ae9bf62cd545f2fad316915ce6bcb707f2deb65f0cc24425c";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/uk/thunderbird-91.1.2.tar.bz2";
+      locale = "uk";
+      arch = "linux-x86_64";
+      sha256 = "8464520b025c29dcf3376d7c47d6c7596ff60eeabe63fc5c41082ceb4fbe148c";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/uz/thunderbird-91.1.2.tar.bz2";
+      locale = "uz";
+      arch = "linux-x86_64";
+      sha256 = "d4ba9eaafed3d475dd0fe3a7df7f9910fe3a95a74b9a83f2a00aa73441ae8a64";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/vi/thunderbird-91.1.2.tar.bz2";
+      locale = "vi";
+      arch = "linux-x86_64";
+      sha256 = "8c7f222e0c65ad2daaf37ab46fbe58e005aa89379a0a87f4b2a5f19528e0e5b2";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/zh-CN/thunderbird-91.1.2.tar.bz2";
+      locale = "zh-CN";
+      arch = "linux-x86_64";
+      sha256 = "1cc053e2e9e751ca14da4a09c276d2c78f61ef4e7d74ac4019849f6ebc044d0d";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-x86_64/zh-TW/thunderbird-91.1.2.tar.bz2";
+      locale = "zh-TW";
+      arch = "linux-x86_64";
+      sha256 = "b77a3eb6d1e51388d1b084956b7cc579e1e3c8ed2bc72d7943ac5d6188e43938";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/af/thunderbird-91.1.2.tar.bz2";
+      locale = "af";
+      arch = "linux-i686";
+      sha256 = "c2015b0cfa07309ca6afe5fefb24c1393a397b1d592dd80ec8b62bd4ef8a3d35";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ar/thunderbird-91.1.2.tar.bz2";
+      locale = "ar";
+      arch = "linux-i686";
+      sha256 = "f36b4e7452ae39bd2bf63231ab884356c7b77d6015993e09046b3d6a63443920";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ast/thunderbird-91.1.2.tar.bz2";
+      locale = "ast";
+      arch = "linux-i686";
+      sha256 = "600d102bbb18bac81e3d50c9ef9a578820b0fa1ba2a6f6d756da6e391fe0f241";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/be/thunderbird-91.1.2.tar.bz2";
+      locale = "be";
+      arch = "linux-i686";
+      sha256 = "46032acc1c16e2c9bd7905799db6253cb16fb6269bb79edf6141b9d2bd5c0b15";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/bg/thunderbird-91.1.2.tar.bz2";
+      locale = "bg";
+      arch = "linux-i686";
+      sha256 = "d21bfe3ad0c2c900de1ab9a88d62fc74c4c1767bb41121159c5c0c9bfe270a8c";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/br/thunderbird-91.1.2.tar.bz2";
+      locale = "br";
+      arch = "linux-i686";
+      sha256 = "8e20c1ce0867bafde00c3e8fc55d5841a14e91fa8039fc7259269da8bfbd4373";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ca/thunderbird-91.1.2.tar.bz2";
+      locale = "ca";
+      arch = "linux-i686";
+      sha256 = "175bfb1b0ef94897ecd359c54a2767ca039a259300a5716211fa0c0593b81023";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/cak/thunderbird-91.1.2.tar.bz2";
+      locale = "cak";
+      arch = "linux-i686";
+      sha256 = "65cf8763200cd10cbc016c9d447703b640c52165c691a604092376de09dc1376";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/cs/thunderbird-91.1.2.tar.bz2";
+      locale = "cs";
+      arch = "linux-i686";
+      sha256 = "8d019c4f92f60c44f1340f96892c0a4060d4ceb86d188f5f81911d92ff2957f0";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/cy/thunderbird-91.1.2.tar.bz2";
+      locale = "cy";
+      arch = "linux-i686";
+      sha256 = "29049a5f4849f7e2bde8ec122de33edb7c86e87eca46b72086e53caedcad7ef1";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/da/thunderbird-91.1.2.tar.bz2";
+      locale = "da";
+      arch = "linux-i686";
+      sha256 = "39d9b429b8ee92b045abf48a605e32a577da1f61459b597698f87b1972993f2d";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/de/thunderbird-91.1.2.tar.bz2";
+      locale = "de";
+      arch = "linux-i686";
+      sha256 = "b8ccae9622a8fa684c48a39a409af461238325d91db5edd8d9ecbeaebf2fa999";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/dsb/thunderbird-91.1.2.tar.bz2";
+      locale = "dsb";
+      arch = "linux-i686";
+      sha256 = "a32e1ec050968c94c2b2c1c175d13629fb5feda14e91a0e6c78a9e1bf4092ebe";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/el/thunderbird-91.1.2.tar.bz2";
+      locale = "el";
+      arch = "linux-i686";
+      sha256 = "7599c18f5c79d6aebb652308fa3fa9b13a4883c0dfc47e8bef6b6c118a2ed909";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/en-CA/thunderbird-91.1.2.tar.bz2";
+      locale = "en-CA";
+      arch = "linux-i686";
+      sha256 = "47c49908cf59a8fa6ec1de512cd01907412cfc5b0f56709611b71eb0b3e6cdee";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/en-GB/thunderbird-91.1.2.tar.bz2";
+      locale = "en-GB";
+      arch = "linux-i686";
+      sha256 = "9f379c2837dab6ece5306117065ddb1f19d3fa08900d5ed63abc34fff8755dda";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/en-US/thunderbird-91.1.2.tar.bz2";
+      locale = "en-US";
+      arch = "linux-i686";
+      sha256 = "97aaf105ff5fd3ac8b2b85ba0de87b1fe6ba01f647d32571b787591ba5f6e1cd";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/es-AR/thunderbird-91.1.2.tar.bz2";
+      locale = "es-AR";
+      arch = "linux-i686";
+      sha256 = "4db46b699d6a65fe482dd8f7bde005b5a4cccfbe7ef777f23f1aa57577d33a33";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/es-ES/thunderbird-91.1.2.tar.bz2";
+      locale = "es-ES";
+      arch = "linux-i686";
+      sha256 = "0a63e85f6992ce683f35ecfe6f0e10854fd8cada33f8a2e066d5ab140ef8c401";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/et/thunderbird-91.1.2.tar.bz2";
+      locale = "et";
+      arch = "linux-i686";
+      sha256 = "522ec0185345054abf61b84dfdb36ce3dbe01c70f5bae11aa17321d18091d759";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/eu/thunderbird-91.1.2.tar.bz2";
+      locale = "eu";
+      arch = "linux-i686";
+      sha256 = "c4e28df0193175149303d80617f04df4d229d8eee2a75129b315a0c23b22aba5";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/fi/thunderbird-91.1.2.tar.bz2";
+      locale = "fi";
+      arch = "linux-i686";
+      sha256 = "046b39db1f3f7c4fbe23e93053d43fe81e1b8751bb0558ad1bad3a50ab698673";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/fr/thunderbird-91.1.2.tar.bz2";
+      locale = "fr";
+      arch = "linux-i686";
+      sha256 = "39d15a1aa3f7c3e360e817baeb3747a49ae8f42d1b46208832eccb0107ca1b3b";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/fy-NL/thunderbird-91.1.2.tar.bz2";
+      locale = "fy-NL";
+      arch = "linux-i686";
+      sha256 = "17c971a57634050faa9fe747055a671ac1ae0022a9b06a957eb05f7bb64f31cb";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ga-IE/thunderbird-91.1.2.tar.bz2";
+      locale = "ga-IE";
+      arch = "linux-i686";
+      sha256 = "58c17ea964de2b60440bb1a078222ab5b6199b83fa5f2854926b9f0c2a6cb3d3";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/gd/thunderbird-91.1.2.tar.bz2";
+      locale = "gd";
+      arch = "linux-i686";
+      sha256 = "4ee45ae272d53f523d2855083f27a0ce005d93ca95d13c2037621a87c294413c";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/gl/thunderbird-91.1.2.tar.bz2";
+      locale = "gl";
+      arch = "linux-i686";
+      sha256 = "68012e665dea95fd4ce4f76dee0b246d2f94890e5a9b3c797e93ae7d450adc58";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/he/thunderbird-91.1.2.tar.bz2";
+      locale = "he";
+      arch = "linux-i686";
+      sha256 = "57125635f8fe2cb50cfe9aecdfe06502cce9c746b346083b329d5e1123d4956d";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/hr/thunderbird-91.1.2.tar.bz2";
+      locale = "hr";
+      arch = "linux-i686";
+      sha256 = "f6f28200c32cc2faa4a4e4a49eed5b4343586b52ca123dbce43d32a1c5059835";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/hsb/thunderbird-91.1.2.tar.bz2";
+      locale = "hsb";
+      arch = "linux-i686";
+      sha256 = "6290282252b9a61fc7ffb1e29b14f31c87832bd60a066c73f9966a10f75ac327";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/hu/thunderbird-91.1.2.tar.bz2";
+      locale = "hu";
+      arch = "linux-i686";
+      sha256 = "fbd6be01153d67870565fc7230fba7b4a1f6151eeda54e84008b0943acfc4564";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/hy-AM/thunderbird-91.1.2.tar.bz2";
+      locale = "hy-AM";
+      arch = "linux-i686";
+      sha256 = "3bfb7979fbfbf0cbdecb8b8030dd209a6e18020ff34a30223ce893c0cfe0a282";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/id/thunderbird-91.1.2.tar.bz2";
+      locale = "id";
+      arch = "linux-i686";
+      sha256 = "4a8801e97b001c0e30ffc4f4a7c712017c1b1a96bf226ddc341728b22599920d";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/is/thunderbird-91.1.2.tar.bz2";
+      locale = "is";
+      arch = "linux-i686";
+      sha256 = "871a6393a716c4c8b2255a8903a4584c8ad4a7f5e1423550d3d96b9866929433";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/it/thunderbird-91.1.2.tar.bz2";
+      locale = "it";
+      arch = "linux-i686";
+      sha256 = "8919dbd9e7b0155de288322f10bbb664189d03c1442657d07d577b33cfce0929";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ja/thunderbird-91.1.2.tar.bz2";
+      locale = "ja";
+      arch = "linux-i686";
+      sha256 = "42e1e1a2b55c97b05ec5424f6318d286f7fa497276ff745c6c221ee2b4c072cd";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ka/thunderbird-91.1.2.tar.bz2";
+      locale = "ka";
+      arch = "linux-i686";
+      sha256 = "4da9353667f109938ebc6740039a915f67d518c109915c1ed42f1552c3be719d";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/kab/thunderbird-91.1.2.tar.bz2";
+      locale = "kab";
+      arch = "linux-i686";
+      sha256 = "87c960236895eb1af70d2f50a839e55befc6486c4883d786b14a67e569c396ae";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/kk/thunderbird-91.1.2.tar.bz2";
+      locale = "kk";
+      arch = "linux-i686";
+      sha256 = "38fdc0aa8fe98d83e52cf266776ebe7a52d7c80e98bc2372afcdeaf709ee8a06";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ko/thunderbird-91.1.2.tar.bz2";
+      locale = "ko";
+      arch = "linux-i686";
+      sha256 = "c960038e1764cc3a0203e2cdf8349ecfee951dbeb470cb58b66c66f0542ee790";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/lt/thunderbird-91.1.2.tar.bz2";
+      locale = "lt";
+      arch = "linux-i686";
+      sha256 = "6387197f1fa9095d64ef3e7c73272f0e0a4a7b857d4be29899bfe2c7aa88a5ec";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/lv/thunderbird-91.1.2.tar.bz2";
+      locale = "lv";
+      arch = "linux-i686";
+      sha256 = "66021a590bb89b9fb50c90bc07788cbbb3d1acaceac5ebf562805d39bb59be3c";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ms/thunderbird-91.1.2.tar.bz2";
+      locale = "ms";
+      arch = "linux-i686";
+      sha256 = "a120efceac13b976b77a49dd2883f66a03c13f3243a53b66afbb372b87c15b16";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/nb-NO/thunderbird-91.1.2.tar.bz2";
+      locale = "nb-NO";
+      arch = "linux-i686";
+      sha256 = "ac5f404b3635b9b327458eb461148d94b52501621e78f2fafeff09c019651948";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/nl/thunderbird-91.1.2.tar.bz2";
+      locale = "nl";
+      arch = "linux-i686";
+      sha256 = "f9dbbb9789a81ee6a40756039afefe542e1369b5de15d4ea728bd5fb5326c728";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/nn-NO/thunderbird-91.1.2.tar.bz2";
+      locale = "nn-NO";
+      arch = "linux-i686";
+      sha256 = "36d0cf0f3132f5365a9cfe5b2175ac6f42dbe25c41a03fbd177509b2cf13abce";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/pa-IN/thunderbird-91.1.2.tar.bz2";
+      locale = "pa-IN";
+      arch = "linux-i686";
+      sha256 = "776c3c215fd0e66eb81c2c91855233c4a7476aad534de555a6317b6a4f664b67";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/pl/thunderbird-91.1.2.tar.bz2";
+      locale = "pl";
+      arch = "linux-i686";
+      sha256 = "ba2aa2dda6c477f3ecb06d0f1d223928adc9a82e46432055783741064cf1e8f6";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/pt-BR/thunderbird-91.1.2.tar.bz2";
+      locale = "pt-BR";
+      arch = "linux-i686";
+      sha256 = "314023714b6babde392b8a30d11e67fe5af9f47e2738d63a6231aa72e6e0b792";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/pt-PT/thunderbird-91.1.2.tar.bz2";
+      locale = "pt-PT";
+      arch = "linux-i686";
+      sha256 = "ea5895b796bbdf9ed5be1277dc0f32c70abb46f37a7d48ecacf39e7b7a5af082";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/rm/thunderbird-91.1.2.tar.bz2";
+      locale = "rm";
+      arch = "linux-i686";
+      sha256 = "d295f9390b7dedec8592751142a42bc134ff3fca5a228d084eb176677c15c4bc";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ro/thunderbird-91.1.2.tar.bz2";
+      locale = "ro";
+      arch = "linux-i686";
+      sha256 = "b4504dd29ce68009c78b7194914c20d41024f92420564d6f4f34369717a49a90";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/ru/thunderbird-91.1.2.tar.bz2";
+      locale = "ru";
+      arch = "linux-i686";
+      sha256 = "a8ba363a9bee130d05d028a84bfc10e8614ac3e3ee7e747d4987691d25423bb0";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/sk/thunderbird-91.1.2.tar.bz2";
+      locale = "sk";
+      arch = "linux-i686";
+      sha256 = "347a0e3e794bebc570aac65005edef1c311d7685d9b7ee4559121945cec1a40e";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/sl/thunderbird-91.1.2.tar.bz2";
+      locale = "sl";
+      arch = "linux-i686";
+      sha256 = "1ae4c2615d9fc4e6b1ab270988de63ff425779945684811a1c9093940e7a9d0a";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/sq/thunderbird-91.1.2.tar.bz2";
+      locale = "sq";
+      arch = "linux-i686";
+      sha256 = "207fb12cf9415e5a66bee33ee2f50adb970343b90bdde2c00c5b149e9ec829ad";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/sr/thunderbird-91.1.2.tar.bz2";
+      locale = "sr";
+      arch = "linux-i686";
+      sha256 = "45e7cb91506dfe353d86b8c6ae172b4a925f6b9ee631b542bc9a0fc77315d482";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/sv-SE/thunderbird-91.1.2.tar.bz2";
+      locale = "sv-SE";
+      arch = "linux-i686";
+      sha256 = "634b1581237baa140d8711458cff99e979b3e33316b24925c6e5700da9603127";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/th/thunderbird-91.1.2.tar.bz2";
+      locale = "th";
+      arch = "linux-i686";
+      sha256 = "a09336e75d270e9fdfaefd4f9e90cddf1f5135602998bfdd9a198e3f1544838c";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/tr/thunderbird-91.1.2.tar.bz2";
+      locale = "tr";
+      arch = "linux-i686";
+      sha256 = "37874416c7bdd2c2b4303a55d14a82ce55a7d8cc6d51bc3b3d215489be3bc055";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/uk/thunderbird-91.1.2.tar.bz2";
+      locale = "uk";
+      arch = "linux-i686";
+      sha256 = "faa0c411431a9b27a7c58c0c394804d3125e4f4e927387df8580c37738c2db44";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/uz/thunderbird-91.1.2.tar.bz2";
+      locale = "uz";
+      arch = "linux-i686";
+      sha256 = "095e56a0fa0e85bebe9bc0044fc13f5da67c7267461b27fb8024947da3f423ba";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/vi/thunderbird-91.1.2.tar.bz2";
+      locale = "vi";
+      arch = "linux-i686";
+      sha256 = "cae3582b504a38497dc63ba25d4be45e450b14cb588a9f52919d0fb4a5a04446";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/zh-CN/thunderbird-91.1.2.tar.bz2";
+      locale = "zh-CN";
+      arch = "linux-i686";
+      sha256 = "58d542c3ceb5e36a83e424250c171477543bcd046f325c89b06f76090410b633";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/91.1.2/linux-i686/zh-TW/thunderbird-91.1.2.tar.bz2";
+      locale = "zh-TW";
+      arch = "linux-i686";
+      sha256 = "13dfa3e7a8b5a69ab9072c21eb22373ff36bd54c9c7c39c3480681bd911043c0";
+    }
+    ];
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-78.patch b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-78.patch
new file mode 100644
index 000000000000..98b40d83d62b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/no-buildconfig-78.patch
@@ -0,0 +1,13 @@
+Remove about:buildconfig.  If used as-is, it would add unnecessary runtime dependencies.
+--- a/comm/mail/base/jar.mn
++++ b/comm/mail/base/jar.mn
+@@ -119,9 +119,7 @@
+ % override chrome://mozapps/content/profile/profileDowngrade.js chrome://messenger/content/profileDowngrade.js
+ % override chrome://mozapps/content/profile/profileDowngrade.xhtml chrome://messenger/content/profileDowngrade.xhtml
+ 
+-*   content/messenger/buildconfig.html              (content/buildconfig.html)
+     content/messenger/buildconfig.css               (content/buildconfig.css)
+-% override chrome://global/content/buildconfig.html chrome://messenger/content/buildconfig.html
+ % override chrome://global/content/buildconfig.css chrome://messenger/content/buildconfig.css
+ 
+ # L10n resources and overrides.
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/packages.nix b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/packages.nix
new file mode 100644
index 000000000000..bc36c81155a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/packages.nix
@@ -0,0 +1,65 @@
+{ stdenv, lib, callPackage, fetchurl, fetchpatch, nixosTests }:
+
+let
+  common = opts: callPackage (import ../../browsers/firefox/common.nix opts) {
+    webrtcSupport = false;
+    geolocationSupport = false;
+  };
+in
+
+rec {
+  thunderbird = common rec {
+    pname = "thunderbird";
+    version = "91.2.0";
+    application = "comm/mail";
+    binaryName = pname;
+    src = fetchurl {
+      url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz";
+      sha512 = "1f21f77069490be2de131f6125a498c6ed0a7d10b2ff787891d8dea10019719fea8014a8b2d626a2365f10f6307b616e5f1eef2c601e4da5402c9d5fc7d35049";
+    };
+    patches = [
+    ];
+
+    meta = with lib; {
+      description = "A full-featured e-mail client";
+      homepage = "https://thunderbird.net/";
+      maintainers = with maintainers; [ eelco lovesegfault pierron vcunat ];
+      platforms = platforms.unix;
+      badPlatforms = platforms.darwin;
+      broken = stdenv.buildPlatform.is32bit; # since Firefox 60, build on 32-bit platforms fails with "out of memory".
+                                             # not in `badPlatforms` because cross-compilation on 64-bit machine might work.
+      license = licenses.mpl20;
+    };
+    updateScript = callPackage ./update.nix {
+      attrPath = "thunderbird-unwrapped";
+    };
+  };
+
+  thunderbird-78 = common rec {
+    pname = "thunderbird";
+    version = "78.14.0";
+    application = "comm/mail";
+    binaryName = pname;
+    src = fetchurl {
+      url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz";
+      sha512 = "0zan30jvv45pd6i59l2kfyfjwivqk5qq6vyf77xhss2dk8qhk3mfrfxpfbkrab676l14b9hs09nr6ni1h1iwn82zx5k7fx5x8sh5dx6";
+    };
+    patches = [
+      ./no-buildconfig-78.patch
+    ];
+
+    meta = with lib; {
+      description = "A full-featured e-mail client";
+      homepage = "https://thunderbird.net/";
+      maintainers = with maintainers; [ eelco lovesegfault pierron vcunat ];
+      platforms = platforms.unix;
+      badPlatforms = platforms.darwin;
+      broken = stdenv.buildPlatform.is32bit; # since Firefox 60, build on 32-bit platforms fails with "out of memory".
+                                             # not in `badPlatforms` because cross-compilation on 64-bit machine might work.
+      license = licenses.mpl20;
+    };
+    updateScript = callPackage ./update.nix {
+      attrPath = "thunderbird-78-unwrapped";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/update.nix b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/update.nix
new file mode 100644
index 000000000000..d6f1a007faa4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/update.nix
@@ -0,0 +1,7 @@
+{ callPackage
+, ...
+}@args:
+
+callPackage ../../browsers/firefox/update.nix ({
+  baseUrl = "http://archive.mozilla.org/pub/thunderbird/releases/";
+} // (builtins.removeAttrs args ["callPackage"]))
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix
new file mode 100644
index 000000000000..0761232cc519
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/thunderbird/wrapper.nix
@@ -0,0 +1,23 @@
+{ lib, wrapFirefox, gpgme, gnupg }:
+
+browser:
+args:
+
+(wrapFirefox browser ({
+  libName = "thunderbird";
+} // args))
+
+.overrideAttrs (old: {
+  # Thunderbird's native GPG support does not yet support smartcards.
+  # The official upstream recommendation is to configure fall back to gnupg
+  # using the Thunderbird config `mail.openpgp.allow_external_gnupg`
+  # and GPG keys set up; instructions with pictures at:
+  # https://anweshadas.in/how-to-use-yubikey-or-any-gpg-smartcard-in-thunderbird-78/
+  # For that to work out of the box, it requires `gnupg` on PATH and
+  # `gpgme` in `LD_LIBRARY_PATH`; we do this below.
+  buildCommand = old.buildCommand + ''
+    wrapProgram $out/bin/thunderbird \
+      --prefix LD_LIBRARY_PATH ':' "${lib.makeLibraryPath [ gpgme ]}" \
+      --prefix PATH ':' "${lib.makeBinPath [ gnupg ]}"
+  '';
+})
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/trojita/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/trojita/default.nix
new file mode 100644
index 000000000000..d7c7320b9e4f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/trojita/default.nix
@@ -0,0 +1,83 @@
+{ akonadi-contacts
+, cmake
+, fetchgit
+, fetchsvn
+, gnupg
+, gpgme
+, kcontacts
+, kf5gpgmepp
+, lib
+, libsecret
+, mimetic
+, mkDerivation
+, pkg-config
+, qgpgme
+, qtbase
+, qtkeychain
+, qttools
+, qtwebkit
+, qttranslations
+, substituteAll
+, withI18n ? false
+}:
+
+let
+  l10n = fetchsvn {
+    url = "svn://anonsvn.kde.org/home/kde/trunk/l10n-kf5";
+    rev = "1566642";
+    sha256 = "0y45fjib153za085la3hqpryycx33dkj3cz8kwzn2w31kvldfl1q";
+  };
+in mkDerivation rec {
+  pname = "trojita";
+  version = "unstable-2020-07-06";
+
+  src = fetchgit {
+    url = "https://anongit.kde.org/trojita.git";
+    rev = "e973a5169f18ca862ceb8ad749c93cd621d86e14";
+    sha256 = "0r8nmlqwgsqkk0k8xh32fkwvv6iylj35xq2h8b7l3g03yc342kbn";
+  };
+
+  patches = (substituteAll {
+    # See https://github.com/NixOS/nixpkgs/issues/86054
+    src = ./fix-qttranslations-path.patch;
+    inherit qttranslations;
+  });
+
+  buildInputs = [
+    akonadi-contacts
+    gpgme
+    kcontacts
+    libsecret
+    mimetic
+    qgpgme
+    qtbase
+    qtkeychain
+    qtwebkit
+    mimetic
+    kf5gpgmepp
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    qttools
+    gnupg
+  ];
+
+  postPatch = "echo ${version} > src/trojita-version"
+    + lib.optionalString withI18n ''
+    mkdir -p po
+    for f in `find ${l10n} -name "trojita_common.po"`; do
+      cp $f po/trojita_common_$(echo $f | cut -d/ -f5).po
+    done
+  '';
+
+  meta = with lib; {
+    description = "A Qt IMAP e-mail client";
+    homepage = "http://trojita.flaska.net/";
+    license = with licenses; [ gpl2 gpl3 ];
+    maintainers = with maintainers; [ ehmry ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/trojita/fix-qttranslations-path.patch b/nixpkgs/pkgs/applications/networking/mailreaders/trojita/fix-qttranslations-path.patch
new file mode 100644
index 000000000000..c4eac3956508
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/trojita/fix-qttranslations-path.patch
@@ -0,0 +1,13 @@
+diff --git i/src/Gui/main.cpp w/src/Gui/main.cpp
+index 851db4f1..e997f46e 100644
+--- i/src/Gui/main.cpp
++++ w/src/Gui/main.cpp
+@@ -52,7 +52,7 @@ int main(int argc, char **argv)
+ 
+     QTranslator qtTranslator;
+     qtTranslator.load(QLatin1String("qt_") + QLocale::system().name(),
+-                      QLibraryInfo::location(QLibraryInfo::TranslationsPath));
++                      QLatin1String("@qttranslations@/translations"));
+     app.installTranslator(&qtTranslator);
+ 
+     QLatin1String localeSuffix("/locale");
diff --git a/nixpkgs/pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix b/nixpkgs/pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix
new file mode 100644
index 000000000000..19354df40adf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/mailreaders/tutanota-desktop/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, lib, fetchurl, makeDesktopItem, copyDesktopItems, makeWrapper,
+electron, libsecret }:
+
+stdenv.mkDerivation rec {
+  pname = "tutanota-desktop";
+  version = "3.88.4";
+
+  src = fetchurl {
+    url = "https://github.com/tutao/tutanota/releases/download/tutanota-release-${version}/${pname}-${version}-unpacked-linux.tar.gz";
+    name = "tutanota-desktop-${version}.tar.gz";
+    sha256 = "sha256-UOb63+NfW6mHKaj3PDEzvz5hcmJBIISq02rtwgSZMjo=";
+  };
+
+  nativeBuildInputs = [
+    copyDesktopItems
+    makeWrapper
+  ];
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  desktopItems = makeDesktopItem {
+    name = pname;
+    exec = "tutanota-desktop";
+    icon = "tutanota-desktop";
+    comment = meta.description;
+    desktopName = "Tutanota Desktop";
+    genericName = "Email Reader";
+  };
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin $out/opt/tutanota-desktop $out/share/tutanota-desktop
+
+    cp -r ./ $out/opt/tutanota-desktop
+    mv $out/opt/tutanota-desktop/{locales,resources} $out/share/tutanota-desktop
+
+    for icon_size in 64 512; do
+      icon=resources/icons/icon/$icon_size.png
+      path=$out/share/icons/hicolor/$icon_size'x'$icon_size/apps/tutanota-desktop.png
+      install -Dm644 $icon $path
+    done
+
+    makeWrapper ${electron}/bin/electron \
+      $out/bin/tutanota-desktop \
+      --add-flags $out/share/tutanota-desktop/resources/app.asar \
+      --run "mkdir /tmp/tutanota" \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libsecret ]}
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Tutanota official desktop client";
+    homepage = "https://tutanota.com/";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ wolfangaukang ];
+    platforms = [ "x86_64-linux" ];
+  };
+}