unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: EuAndreh via Guix-patches via <guix-patches@gnu.org>
To: 59701@debbugs.gnu.org
Cc: EuAndreh <eu@euandre.org>
Subject: [bug#59701] [PATCH] gnu: mailutils: Inform correct path of sendmail.
Date: Tue, 29 Nov 2022 18:55:41 -0300	[thread overview]
Message-ID: <20221129215541.26224-1-eu@euandre.org> (raw)

* gnu/packages/mail.scm (mailutils)[arguments]: Add -DPATH_SENDMAIL
  to CFLAGS pointing to /run/setuid-programs.
---

Notes:
    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
      From: root
      To: root
      Subject: This fails
    
      The body
      $ mail -t < mail.txt
      mail: Cannot open mailer: No such file or directory
      mail: cannot send message: No such file or directory
      $ echo $?
      1
    
    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(+)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index cef5fe2916..2c42cdfaca 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -347,6 +347,9 @@ (define-public mailutils
            #~(list "--sysconfdir=/etc"
                    "--disable-static"
 
+                   ;; Specify path to sendmail setuid binary, which otherwise
+                   ;; defaults to /usr/sbin/sendmail
+                   "CFLAGS=-DPATH_SENDMAIL=\\\"/run/setuid-programs\\\""
                    ;; Add "/X.Y" to the installation directory.
                    (string-append "--with-guile-site-dir="
                                   (assoc-ref %outputs "out")
-- 
2.38.1





             reply	other threads:[~2022-11-29 21:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-29 21:55 EuAndreh via Guix-patches via [this message]
2022-11-29 21:57 ` [bug#59701] [PATCH v2] gnu: mailutils: Inform correct path of sendmail EuAndreh via Guix-patches via
2022-11-29 22:11 ` [bug#59701] [PATCH] " Tobias Geerinckx-Rice via Guix-patches via
2022-11-29 22:31   ` EuAndreh via Guix-patches via
2022-11-29 22:33     ` EuAndreh via Guix-patches via
2022-12-01  8:26     ` Efraim Flashner
2022-12-01  9:40       ` EuAndreh via Guix-patches via
2022-12-01 10:15         ` EuAndreh via Guix-patches via
2022-12-01 10:30       ` EuAndreh via Guix-patches via
2022-12-13  6:33         ` 宋文武 via Guix-patches via
2022-12-01 14:19     ` Tobias Geerinckx-Rice via Guix-patches via
2022-12-01 15:25       ` EuAndreh via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221129215541.26224-1-eu@euandre.org \
    --to=guix-patches@gnu.org \
    --cc=59701@debbugs.gnu.org \
    --cc=eu@euandre.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).