nixpkgs/pkgs/applications/networking/mailreaders/claws-mail/default.nix
Alvar Penning 62eed9ab29 claws-mail: patch mailto handling
The "Mailto: Me Your Secrets"[0] paper describes vulnerabilities in
multiple email clients regarding the undocumented "attach" field of a
mailto URI. This might allow the inclusion of sensitive data in an
outgoing email.

Pull request #95758 addresses this issue on a more general level.

Claws Mail unfortunately also has problems with mailto URIs[1][2].
Referring to the paper, problems for "attach" and "insert" were found
and fixed. These patches, which are not included in a release yet, are
hereby added.

[0]:https://www.nds.ruhr-uni-bochum.de/media/nds/veroeffentlichungen/2020/08/15/mailto-paper.pdf
[1]:https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4373
[2]:https://www.thewildbeast.co.uk/claws-mail/bugzilla/show_bug.cgi?id=4374
2020-09-10 10:12:23 +02:00

123 lines
4.4 KiB
Nix

{ config, fetchurl, fetchpatch, stdenv, wrapGAppsHook, autoreconfHook
, curl, dbus, dbus-glib, enchant, gtk2, gnutls, gnupg, gpgme
, libarchive, libcanberra-gtk2, libetpan, libnotify, libsoup, libxml2, networkmanager
, openldap, perl, pkgconfig, poppler, python, shared-mime-info
, glib-networking, gsettings-desktop-schemas, libSM, libytnef, libical
# Build options
# TODO: A flag to build the manual.
# TODO: Plugins that complain about their missing dependencies, even when
# provided:
# gdata requires libgdata
# geolocation requires libchamplain
, enableLdap ? false
, enableNetworkManager ? config.networking.networkmanager.enable or false
, enablePgp ? true
, enablePluginArchive ? false
, enablePluginNotificationDialogs ? true
, enablePluginNotificationSounds ? true
, enablePluginPdf ? false
, enablePluginPython ? false
, enablePluginRavatar ? false
, enablePluginRssyl ? false
, enablePluginSmime ? false
, enablePluginSpamassassin ? false
, enablePluginSpamReport ? false
, enablePluginVcalendar ? false
, enableSpellcheck ? false
}:
with stdenv.lib;
stdenv.mkDerivation rec {
pname = "claws-mail";
version = "3.17.6";
src = fetchurl {
url = "http://www.claws-mail.org/download.php?file=releases/claws-mail-${version}.tar.xz";
sha256 = "1s05qw0r0gqwvvkxvrrwbjkbi61dvilixiwrpgcq21qc9csc9r0m";
};
outputs = [ "out" "dev" ];
patches = [
./mime.patch
# Backports a mitigation to the "mailto vulnerability". This patch is
# included in the next release and must therefore be removed.
(fetchpatch {
name = "fix-4373-4374.patch";
url = "https://git.claws-mail.org/?p=claws.git;a=patch;h=4c9d15b4b37cdc57edfa16df550a0a881a156153";
sha256 = "0sp0vxr6pk2fv5ydpcakb50rmn2w2nma98apgfsgcgan82qmwk7n";
})
];
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
'';
postPatch = ''
substituteInPlace src/procmime.c \
--subst-var-by MIMEROOTDIR ${shared-mime-info}/share
'';
nativeBuildInputs = [ autoreconfHook pkgconfig wrapGAppsHook python.pkgs.wrapPython ];
propagatedBuildInputs = with python.pkgs; [ python ] ++ optionals enablePluginPython [ pygtk pygobject2 ];
buildInputs =
[ curl dbus dbus-glib gtk2 gnutls gsettings-desktop-schemas
libetpan perl glib-networking libSM libytnef
]
++ optional enableSpellcheck enchant
++ optionals (enablePgp || enablePluginSmime) [ gnupg gpgme ]
++ optional enablePluginArchive libarchive
++ optional enablePluginNotificationSounds libcanberra-gtk2
++ optional enablePluginNotificationDialogs libnotify
++ optional enablePluginRssyl libxml2
++ optional enableNetworkManager networkmanager
++ optional enableLdap openldap
++ optional enablePluginPdf poppler
++ optional enablePluginVcalendar libical;
configureFlags =
optional (!enableLdap) "--disable-ldap"
++ optional (!enableNetworkManager) "--disable-networkmanager"
++ optionals (!enablePgp) [
"--disable-pgpcore-plugin"
"--disable-pgpinline-plugin"
"--disable-pgpmime-plugin"
]
++ optional (!enablePluginArchive) "--disable-archive-plugin"
++ optional (!enablePluginPdf) "--disable-pdf_viewer-plugin"
++ optional (!enablePluginPython) "--disable-python-plugin"
++ optional (!enablePluginRavatar) "--disable-libravatar-plugin"
++ optional (!enablePluginRssyl) "--disable-rssyl-plugin"
++ optional (!enablePluginSmime) "--disable-smime-plugin"
++ optional (!enablePluginSpamassassin) "--disable-spamassassin-plugin"
++ optional (!enablePluginSpamReport) "--disable-spam_report-plugin"
++ optional (!enablePluginVcalendar) "--disable-vcalendar-plugin"
++ optional (!enableSpellcheck) "--disable-enchant";
enableParallelBuilding = true;
pythonPath = with python.pkgs; [ pygobject2 pygtk ];
preFixup = ''
buildPythonPath "$out $pythonPath"
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.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ fpletz globin orivej ];
};
}