28 , pythonSupport ? true
32 stdenv.mkDerivation rec {
37 url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
38 hash = "sha256-+km6zsN1Zv5S+IIh04cWc6Yzru4M2SPMOo5lu+8rhOk=";
41 separateDebugInfo = true;
44 sed -i -e '/chown root:mail/d' \
45 -e 's/chmod [24]755/chmod 0755/' \
47 sed -i 's:/usr/lib/mysql:${libmysqlclient}/lib/mysql:' configure.ac
70 ] ++ lib.optionals stdenv.hostPlatform.isLinux [ nettools ]
71 ++ lib.optionals pythonSupport [ python3 ]
72 ++ lib.optionals guileSupport [ guile_2_2 ];
75 ./fix-build-mb-len-max.patch
77 # Fix cross-compilation
78 # https://lists.gnu.org/archive/html/bug-mailutils/2020-11/msg00038.html
80 url = "https://lists.gnu.org/archive/html/bug-mailutils/2020-11/txtiNjqcNpqOk.txt";
81 sha256 = "0ghzqb8qx2q8cffbvqzw19mivv7r5f16whplzhm7hdj0j2i6xf6s";
83 # https://github.com/NixOS/nixpkgs/issues/223967
84 # https://lists.gnu.org/archive/html/bug-mailutils/2023-04/msg00000.html
85 ./don-t-use-descrypt-password-in-the-test-suite.patch
88 enableParallelBuilding = true;
89 hardeningDisable = [ "format" ];
96 "--with-path-sendmail=${system-sendmail}/bin/sendmail"
97 "--with-mail-rc=/etc/mail.rc"
98 "DEFAULT_CUPS_CONFDIR=${mailcap}/etc" # provides mime.types to mimeview
99 ] ++ lib.optional (!pythonSupport) "--without-python"
100 ++ lib.optional (!guileSupport) "--without-guile";
102 nativeCheckInputs = [ dejagnu mkpasswd ];
103 doCheck = !stdenv.hostPlatform.isDarwin; # ERROR: All 46 tests were run, 46 failed unexpectedly.
104 doInstallCheck = false; # fails
107 # Disable comsat tests that fail without tty in the sandbox.
108 tty -s || echo > comsat/tests/testsuite.at
109 # Remove broken macro
110 sed -i '/AT_TESTED/d' libmu_scm/tests/testsuite.at
111 # Provide libraries for mhn.
112 export LD_LIBRARY_PATH=$(pwd)/lib/.libs
116 unset LD_LIBRARY_PATH
120 description = "Rich and powerful protocol-independent mail framework";
123 GNU Mailutils is a rich and powerful protocol-independent mail
124 framework. It contains a series of useful mail libraries, clients, and
125 servers. These are the primary mail utilities for the GNU system. The
126 central library is capable of handling electronic mail in various
127 mailbox formats and protocols, both local and remote. Specifically,
128 this project contains a POP3 server, an IMAP4 server, and a Sieve mail
129 filter. It also provides a POSIX `mailx' client, and a collection of
132 The GNU Mailutils libraries supply an ample set of primitives for
133 handling electronic mail in programs written in C, C++, Python or
136 The utilities provided by Mailutils include imap4d and pop3d mail
137 servers, mail reporting utility comsatd, mail filtering program sieve,
138 and an implementation of MH message handling system.
141 license = with licenses; [
142 lgpl3Plus /* libraries */
146 maintainers = with maintainers; [ orivej ];
148 homepage = "https://www.gnu.org/software/mailutils/";
149 changelog = "https://git.savannah.gnu.org/cgit/mailutils.git/tree/NEWS";
151 # Some of the dependencies fail to build on {cyg,dar}win.
152 platforms = platforms.gnu ++ platforms.unix;