diff mbox series

[bug#45153,v2] gnu: rottlog: Fix mail reporting.

Message ID 20201212084639.29377-1-dftxbs3e@free.fr
State Accepted
Headers show
Series [bug#45153,v2] gnu: rottlog: Fix mail reporting. | expand

Checks

Context Check Description
cbaines/submitting builds success
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch success View Laminar job
cbaines/issue success View issue

Commit Message

dftxbs3e Dec. 12, 2020, 8:46 a.m. UTC
From: Léo Le Bouter <lle-bout@zaclys.net>

* gnu/packages/admin.scm (rottlog):
[inputs]: Add sendmail.
[phases]: Modify 'patch-paths to substitute sendmail command with
/gnu/store item.
---
 gnu/packages/admin.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Comments

Efraim Flashner Dec. 12, 2020, 8:25 p.m. UTC | #1
If there's no mail server setup on the Guix System machine where does
the mail go?

On Sat, Dec 12, 2020 at 09:46:39AM +0100, John Doe wrote:
> From: Léo Le Bouter <lle-bout@zaclys.net>
> 
> * gnu/packages/admin.scm (rottlog):
> [inputs]: Add sendmail.
> [phases]: Modify 'patch-paths to substitute sendmail command with
> /gnu/store item.
> ---
>  gnu/packages/admin.scm | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> index 9df14b5ca0..9394545003 100644
> --- a/gnu/packages/admin.scm
> +++ b/gnu/packages/admin.scm
> @@ -107,6 +107,7 @@
>    #:use-module (gnu packages libusb)
>    #:use-module (gnu packages linux)
>    #:use-module (gnu packages lua)
> +  #:use-module (gnu packages mail)
>    #:use-module (gnu packages man)
>    #:use-module (gnu packages mcrypt)
>    #:use-module (gnu packages mpi)
> @@ -1343,9 +1344,11 @@ at once based on a Perl regular expression.")
>  
>         #:phases (modify-phases %standard-phases
>                    (add-after 'unpack 'patch-paths
> -                    (lambda _
> +                    (lambda* (#:key inputs #:allow-other-keys)
>                        (substitute* "rc/rc"
> -                        (("/usr/sbin/sendmail") "sendmail"))
> +                        (("/usr/sbin/sendmail")
> +                         (string-append (assoc-ref inputs "sendmail")
> +                                        "/usr/sbin/sendmail")))
>                        #t))
>                    (add-after 'unpack 'fix-configure
>                      (lambda* (#:key inputs native-inputs #:allow-other-keys)
> @@ -1384,7 +1387,8 @@ at once based on a Perl regular expression.")
>      (native-inputs `(("texinfo" ,texinfo)
>                       ("automake" ,automake)
>                       ("util-linux" ,util-linux))) ; for 'cal'
> -    (inputs `(("coreutils*" ,coreutils)))
> +    (inputs `(("coreutils*" ,coreutils)
> +              ("sendmail" ,sendmail)))
>      (home-page "https://www.gnu.org/software/rottlog/")
>      (synopsis "Log rotation and management")
>      (description
> -- 
> 2.29.2
> 
> 
> 
>
dftxbs3e Dec. 12, 2020, 8:49 p.m. UTC | #2
On Sat, 2020-12-12 at 22:25 +0200, Efraim Flashner wrote:
> If there's no mail server setup on the Guix System machine where does
> the mail go?

Not sure, I don't know how rottlog works and what parameters it gives
to sendmail. Can emails be sent without a mail server? Like when they
are sent to a UNIX account for example? That's what I would guess it
does, write mail to /var/mail/root or something.

Actually fixing mail reporting might need additional patching, I
focused on fixing the issue I met and had logs of.
diff mbox series

Patch

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 9df14b5ca0..9394545003 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -107,6 +107,7 @@ 
   #:use-module (gnu packages libusb)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages lua)
+  #:use-module (gnu packages mail)
   #:use-module (gnu packages man)
   #:use-module (gnu packages mcrypt)
   #:use-module (gnu packages mpi)
@@ -1343,9 +1344,11 @@  at once based on a Perl regular expression.")
 
        #:phases (modify-phases %standard-phases
                   (add-after 'unpack 'patch-paths
-                    (lambda _
+                    (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* "rc/rc"
-                        (("/usr/sbin/sendmail") "sendmail"))
+                        (("/usr/sbin/sendmail")
+                         (string-append (assoc-ref inputs "sendmail")
+                                        "/usr/sbin/sendmail")))
                       #t))
                   (add-after 'unpack 'fix-configure
                     (lambda* (#:key inputs native-inputs #:allow-other-keys)
@@ -1384,7 +1387,8 @@  at once based on a Perl regular expression.")
     (native-inputs `(("texinfo" ,texinfo)
                      ("automake" ,automake)
                      ("util-linux" ,util-linux))) ; for 'cal'
-    (inputs `(("coreutils*" ,coreutils)))
+    (inputs `(("coreutils*" ,coreutils)
+              ("sendmail" ,sendmail)))
     (home-page "https://www.gnu.org/software/rottlog/")
     (synopsis "Log rotation and management")
     (description