Subject: bug#75571: closed (Re: Queued messages in OpenSMTPd)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 22 Jan 2025 14:29:07 +0000

Your bug report

#75571: [PATCH] gnu: opensmtpd: Fix fix for queuing of offline messages.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
75571: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=75571
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: Queued messages in OpenSMTPd
From: Andreas Enge <[email-masked]>
To: Felix Lechner <[email-masked]>
Cc: Tomas Volf <[email-masked]>, [email-masked]
Date: Wed, 22 Jan 2025 15:28:24 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Am Wed, Jan 15, 2025 at 10:58:43AM -0800 schrieb Felix Lechner:
> The path is also incorrect in my binary.  I'm not sure why I believe it
> worked once.
> 
> The mail queue on my server is presently empty, and I don't have time to
> experiment.  Instead, I take your word for it and wholeheartedly support
> the acceptance of this patch.  Thanks for working on it!
> 
> Cc: Andreas Enge, who may have committed my original change.

Well, I sometimes do this kind of things without understanding them and
without remembering them afterwards...

The patch looks good on the surface of it, and since the two of you have
tested it, I have just pushed it. Thanks!

Andreas

Subject: [PATCH] gnu: opensmtpd: Fix fix for queuing of offline messages.
From: Tomas Volf <[email-masked]>
To: [email-masked]
Cc: Tomas Volf <[email-masked]>
Date: Wed, 15 Jan 2025 02:38:11 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

The substituted path in smtpd.h was not used due to an #ifndef.  The correct
place to patch it seems to be mk/pathnames.  This sadly triggers a bootstrap,
so we need to add autoconf and automake to the native-inputs.

* gnu/packages/mail.scm (opensmtpd)[arguments]<#:phases>
{'patch-test-FHS-file-names}: Patch in mk/pathnames instead.
[native-inputs]: Add autoconf and automake.

Change-Id: I1d569b8aaae839d6fd4871ccb97c116e6930f1c9
---
 gnu/packages/mail.scm | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 3744288fa3..5a16d670a3 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -3311,7 +3311,9 @@ (define-public opensmtpd
            libxcrypt
            zlib))
     (native-inputs
-     (list bison
+     (list autoconf
+           automake
+           bison
            groff                        ;for man pages
            pkg-config))
     (arguments
@@ -3336,10 +3338,13 @@ (define-public opensmtpd
          ;; Fix some incorrectly hard-coded external tool file names.
          (add-after 'unpack 'patch-FHS-file-names
            (lambda* (#:key inputs #:allow-other-keys)
-             ;; avoids warning smtpd: couldn't enqueue offline message
-             ;; smtpctl exited abnormally
-             (substitute* "usr.sbin/smtpd/smtpd.h"
-               (("/usr/bin/smtpctl") "/run/privileged/bin/smtpctl"))
+             (substitute* "mk/pathnames"
+               ;; avoids warning smtpd: couldn't enqueue offline message
+               ;; smtpctl exited abnormally
+               (("(-DPATH_SMTPCTL=).*\\\\" all def)
+                (string-append def "\\\"/run/privileged/bin/smtpctl\\\" \\"))
+               (("(-DPATH_MAKEMAP=).*\\\\" all def)
+                (string-append def "\\\"/run/privileged/bin/makemap\\\" \\")))
              (substitute* "usr.sbin/smtpd/smtpctl.c"
                ;; ‘gzcat’ is auto-detected at compile time, but ‘cat’ isn't.
                (("/bin/cat" file) (search-input-file inputs file)))
-- 
2.47.1