28 stdenv.mkDerivation rec {
33 url = "mirror://gnu/${pname}/${pname}-${version}.tar.xz";
34 hash = "sha256-wMWzj+qLRaSvzUNkh/Knb9VSUJLQN4gTputVQsIScTk=";
37 separateDebugInfo = true;
40 sed -i -e '/chown root:mail/d' \
41 -e 's/chmod [24]755/chmod 0755/' \
43 sed -i 's:/usr/lib/mysql:${libmysqlclient}/lib/mysql:' configure.ac
68 ] ++ lib.optionals stdenv.isLinux [ nettools ];
71 ./fix-build-mb-len-max.patch
73 # Fix cross-compilation
74 # https://lists.gnu.org/archive/html/bug-mailutils/2020-11/msg00038.html
76 url = "https://lists.gnu.org/archive/html/bug-mailutils/2020-11/txtiNjqcNpqOk.txt";
77 sha256 = "0ghzqb8qx2q8cffbvqzw19mivv7r5f16whplzhm7hdj0j2i6xf6s";
81 enableParallelBuilding = false;
82 hardeningDisable = [ "format" ];
88 "--with-path-sendmail=${system-sendmail}/bin/sendmail"
89 "--with-mail-rc=/etc/mail.rc"
90 "DEFAULT_CUPS_CONFDIR=${mailcap}/etc" # provides mime.types to mimeview
94 p = "https://raw.githubusercontent.com/gentoo/gentoo/9c921e89d51876fd876f250324893fd90c019326/net-mail/mailutils/files";
96 (fetchurl { url = "${p}/hdr.at"; sha256 = "0phpkqyhs26chn63wjns6ydx9468ng3ssbjbfhcvza8h78jlsd98"; })
97 (fetchurl { url = "${p}/nohdr.at"; sha256 = "1vkbkfkbqj6ml62s1am8i286hxwnpsmbhbnq0i2i0j1i7iwkk4b7"; })
98 (fetchurl { url = "${p}/twomsg.at"; sha256 = "15m29rg2xxa17xhx6jp4s2vwa9d4khw8092vpygqbwlhw68alk9g"; })
99 (fetchurl { url = "${p}/weed.at"; sha256 = "1101xakhc99f5gb9cs3mmydn43ayli7b270pzbvh7f9rbvh0d0nh"; })
102 checkInputs = [ dejagnu ];
103 doCheck = false; # fails 1 out of a bunch of tests, looks like a bug
104 doInstallCheck = false; # fails
107 # Add missing test files
108 cp ${builtins.toString readmsg-tests} readmsg/tests/
109 for f in hdr.at nohdr.at twomsg.at weed.at; do
110 mv readmsg/tests/*-$f readmsg/tests/$f
112 # Disable comsat tests that fail without tty in the sandbox.
113 tty -s || echo > comsat/tests/testsuite.at
114 # Disable lmtp tests that require root spool.
115 echo > maidag/tests/lmtp.at
116 # Disable mda tests that require /etc/passwd to contain root.
117 grep -qo '^root:' /etc/passwd || echo > maidag/tests/mda.at
118 # Provide libraries for mhn.
119 export LD_LIBRARY_PATH=$(pwd)/lib/.libs
123 unset LD_LIBRARY_PATH
127 description = "Rich and powerful protocol-independent mail framework";
130 GNU Mailutils is a rich and powerful protocol-independent mail
131 framework. It contains a series of useful mail libraries, clients, and
132 servers. These are the primary mail utilities for the GNU system. The
133 central library is capable of handling electronic mail in various
134 mailbox formats and protocols, both local and remote. Specifically,
135 this project contains a POP3 server, an IMAP4 server, and a Sieve mail
136 filter. It also provides a POSIX `mailx' client, and a collection of
139 The GNU Mailutils libraries supply an ample set of primitives for
140 handling electronic mail in programs written in C, C++, Python or
143 The utilities provided by Mailutils include imap4d and pop3d mail
144 servers, mail reporting utility comsatd, general-purpose mail delivery
145 agent maidag, mail filtering program sieve, and an implementation of MH
146 message handling system.
149 license = with licenses; [
150 lgpl3Plus /* libraries */
154 maintainers = with maintainers; [ orivej vrthra ];
156 homepage = "https://www.gnu.org/software/mailutils/";
158 # Some of the dependencies fail to build on {cyg,dar}win.
159 platforms = platforms.gnu ++ platforms.unix;