GNU bug report logs - #59701
[PATCH] gnu: mailutils: Inform correct path of sendmail.

Previous Next

Package: guix-patches;

Reported by: EuAndreh <eu <at> euandre.org>

Date: Tue, 29 Nov 2022 21:56:01 UTC

Severity: normal

Tags: moreinfo, patch

Full log


Message #38 received at 59701 <at> debbugs.gnu.org (full text, mbox):

From: EuAndreh <eu <at> euandre.org>
To: Efraim Flashner <efraim <at> flashner.co.il>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, 59701 <at> debbugs.gnu.org
Subject: Re: [bug#59701] [PATCH] gnu: mailutils: Inform correct path of
 sendmail.
Date: Thu, 1 Dec 2022 10:15:55 +0000
Come to think of it, I did try it.  It required a significant amount of 
patches to the source code itself, to the point where one should prepare 
a patchset and send upstream, after refactoring some of the code.

The problem is that the aforementioned search path used is searched at 
compile-time, and if no sendmail binary is found, the absolute fallback 
path is used instead.  So instead of a run-time $PATH lookup, it has a 
compile-time /usr/sbin:/usr/lib:/etc lookup, with a /usr/sbin/sendmail 
fallback.

Ideally we would like to have:

1. not looking for sendmail binaries at compile-time, and relying on 
$PATH instead;
2. not having a fallback absolute path to a fallback binary, and just 
get a ENOENT at runtime instead, plus a few more diagnostic messages to 
STDERR.

As I progressed in achieving that, I had modification on top of 
modification to the build system and the source code, and at some point 
I found myself questioning the approach, as it was becoming too fragile 
and too custom.

There is no bug registered in GNU Mailutils' bug database, but there is 
a thread [0] in its list with people talking about when the exact same 
problem was encountered when our friends at Nix packaged mailutils [1].

The suggestion [2] from the maintainer is actually to put a symlink to 
the setuid sendmail binary where mailutils expects to find it:

> There's no way to do this currently, except for symlinking the actual
> sendmail-compatible binary (whatever it is in your distro) to the
> predefined path (preferably, to the place defined by _PATH_SENDMAIL
> in your /usr/include/paths.h). In fact, that's what all distros that
> I've ever seen do.

The difference for Guix (and Nix) is that /usr/sbin/ doesn't even exist, 
so we use the PATH_SENDMAIL macro to tell mailutils where to find 
sendmail, as upstream seems happy with the state of affairs.


[0]: https://lists.gnu.org/archive/html/bug-mailutils/2017-10/msg00004.html
[1]: https://github.com/NixOS/nixpkgs/issues/21008
[2]: https://lists.gnu.org/archive/html/bug-mailutils/2017-10/msg00001.html




This bug report was last modified 2 years and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.