* gnu/packages/mail.scm (mailutils)[arguments]: Add -DPATH_SENDMAIL
to CFLAGS pointing to /run/setuid-programs.
The current compilation options of GNU Mailutils don't specify a value
for the "PATH_SENDMAIL" C macro. The build system of the package looks
for a definition of this variable in the "paths.h" header file from the
glibc package, and falls back to what is defined as the default in its
"paths" file, /usr/sbin/sendmail.
As this binary doesn't exist, "mail" fails to execute:
$ cat mail.txt
Subject: This fails
$ mail -t < mail.txt
mail: Cannot open mailer: No such file or directory
mail: cannot send message: No such file or directory
$ echo $?
I've confirmed this by looking at the file called "paths" in the source
code of mailutils, and at the strace output of calling mailutils. I
do have a working sendmail binary under /run/setuid-programs, and it
now it is correctly called by the "mail" command, from mailutils.
Given that this was the default, probably most Guix users do have a
/root/dead.letter, with emails from the system, mainly rottlog
notifications of log rotations, as it does use GNU Mailutils directly in
its /etc/rottlog/rc configuration.
gnu/packages/mail.scm | 3 +++
1 file changed, 3 insertions(+)
Toggle diff (16 lines)
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index cef5fe2916..2c42cdfaca 100644
@@ -347,6 +347,9 @@ (define-public mailutils
+ ;; Specify path to sendmail setuid binary, which otherwise
+ ;; defaults to /usr/sbin/sendmail
;; Add "/X.Y" to the installation directory.
(assoc-ref %outputs "out")