From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 01 05:35:24 2022 Received: (at 59701) by debbugs.gnu.org; 1 Dec 2022 10:35:24 +0000 Received: from localhost ([127.0.0.1]:38871 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0gua-0007YI-Fl for submit@debbugs.gnu.org; Thu, 01 Dec 2022 05:35:24 -0500 Received: from euandre.org ([216.238.68.100]:56058) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p0guY-0007Y1-Bn for 59701@debbugs.gnu.org; Thu, 01 Dec 2022 05:35:23 -0500 Received: from euandre.org (localhost [127.0.0.1]) by euandre.org (Postfix) with ESMTP id 810993AA6FC; Thu, 1 Dec 2022 07:35:17 -0300 (-03) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=euandre.org; h= message-id:date:mime-version:from:to:references:subject :in-reply-to:content-type:content-transfer-encoding; s= dkimproxy; bh=5BAmQn3m5DRTYN4vFeGeCZM9yGk=; b=AHAieNL/kkO7bA51YM qavANwNbZeHfe5tadD52XF2tXDndtHyybX/wpu1OQjmslp5e4FrZhqduRKsXFVuC Lb0BNwF2LvKzzdNLWUCMG1H2fIdWvVhBaFpjTXB5t//vIf3HxqKEZL4HoXMifRqo M2t5gNev62JXPaefkZMboZZrNQtFFijWEBo4WO9CbY5u9OApVH1ECe8PBhbVi8C5 Mo6IpHIYc9CjOYmotneu+RzCebNgnM9lTIPEk2EJY1gOH68duxttPf4wF8DX8Grw Hz2lh37dou+gm0Rr8SwW+o2peePyNH8/mWNKYIrgNSbHf4Q0xOgQNY2SAdLbmoVE yQMQ== Message-ID: Date: Thu, 1 Dec 2022 10:15:55 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Content-Language: en-US, pt, fr, eo, en From: EuAndreh To: Efraim Flashner , Tobias Geerinckx-Rice , 59701@debbugs.gnu.org References: <20221129215541.26224-1-eu@euandre.org> <87o7spe7do.fsf@nckx> Subject: Re: [bug#59701] [PATCH] gnu: mailutils: Inform correct path of sendmail. In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59701 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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