bug-mcron
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-mcron] [PATCH] configure: Add '--with-sendmail' for (mcron config c


From: 宋文武
Subject: [Bug-mcron] [PATCH] configure: Add '--with-sendmail' for (mcron config config-sendmail)
Date: Mon, 01 Oct 2018 14:38:12 +0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

Hello, this patch add '--with-sendmail' option to the configure script.

With it, I can set the sendmail command (config-sendmail) directly.

Without it, the configure script fails to get a working sendmail command
due to missing 'ac_cv_prog_WHICH'...

>From f59066b5cc474fa5d531a1ee44baa46b728f4fbd Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E6=96=87=E6=AD=A6?= <address@hidden>
Date: Mon, 1 Oct 2018 14:07:48 +0800
Subject: [PATCH] configure: Add '--with-sendmail' for (mcron config
 config-sendmail).

* build-aux/guix.scm: Remove 'which' from native-inputs of the package.
* configure.ac: Add '--with-sendmail' option to set the command of sendmail
directly.
* src/mcron/redirect.scm (with-mail-out): Don't add USER to the command of
sendmail.
---
 build-aux/guix.scm     |  3 +--
 configure.ac           | 29 +++++++++--------------------
 src/mcron/redirect.scm |  5 +----
 3 files changed, 11 insertions(+), 26 deletions(-)

diff --git a/build-aux/guix.scm b/build-aux/guix.scm
index d90e0be..53bf570 100644
--- a/build-aux/guix.scm
+++ b/build-aux/guix.scm
@@ -62,5 +62,4 @@
      ("automake" ,(specification->package "automake"))
      ("help2man" ,(specification->package "help2man"))
      ("pkg-config" ,(specification->package "pkg-config"))
-     ("texinfo" ,(specification->package "texinfo"))
-     ("which" ,(specification->package "which")))))
+     ("texinfo" ,(specification->package "texinfo")))))
diff --git a/configure.ac b/configure.ac
index 0bb9262..e8a135a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -55,26 +55,15 @@ GUILE_PROGS
 
 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
 
-# Now find a sendmail or equivalent.
-
-AC_CHECK_PROGS(SENDMAIL, sendmail)
-if test "x$ac_cv_prog_SENDMAIL" != "x"; then
-   AC_MSG_CHECKING(sendmail path and arguments)
-   ac_cv_prog_SENDMAIL="`$ac_cv_prog_WHICH sendmail` -FCronDaemon -odi -oem "
-dnl  -or0s"
-   AC_MSG_RESULT($ac_cv_prog_SENDMAIL)
-
-else
-   AC_CHECK_PROGS(SENDMAIL, mail)
-   if test "x$ac_cv_prog_SENDMAIL" != "x"; then
-      AC_MSG_CHECKING(mail path)
-      ac_cv_prog_SENDMAIL="`$ac_cv_prog_WHICH mail` -d "
-      AC_MSG_RESULT($ac_cv_prog_SENDMAIL)
-   else
-      AC_MSG_RESULT(No mail program found)
-   fi
-fi
-SENDMAIL=$ac_cv_prog_SENDMAIL
+AC_MSG_CHECKING([sendmail command])
+AC_ARG_WITH(sendmail,
+            AC_HELP_STRING([--with-sendmail=COMMAND],
+                           [command to read an email message from
+                           standard input, and send it]),
+              SENDMAIL=$withval,
+              SENDMAIL=["sendmail -t"])
+AC_MSG_RESULT($SENDMAIL)
+AC_SUBST(SENDMAIL)
 
 AC_ARG_ENABLE([multi-user],
   [AS_HELP_STRING([--disable-multi-user],
diff --git a/src/mcron/redirect.scm b/src/mcron/redirect.scm
index 6711407..88d3527 100644
--- a/src/mcron/redirect.scm
+++ b/src/mcron/redirect.scm
@@ -170,10 +170,7 @@
           (set-current-output-port (if (and (string? mailto)
                                             (string=? mailto ""))
                                        (open-output-file "/dev/null")
-                                       (open-output-pipe
-                                          (string-append config-sendmail
-                                                         " "
-                                                         user))))
+                                       (open-output-pipe config-sendmail)))
           (set-current-input-port (car child->parent))
           (display "To: ") (display user) (newline)
           (display "From: mcron") (newline)
-- 
2.19.0

Thanks!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]