Fix MAILFROM envelope address handling
Resolves: RHEL-140696
This commit is contained in:
parent
3ff7f3661f
commit
b613b536be
34
0001-Revert-do-not-put-in-quotation-marks.patch
Normal file
34
0001-Revert-do-not-put-in-quotation-marks.patch
Normal file
@ -0,0 +1,34 @@
|
||||
From 3428028e6df0a1e9b2efa1cb52b2722f790d9741 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Mraz <tmraz@fedoraproject.org>
|
||||
Date: Thu, 16 Nov 2023 18:01:00 +0100
|
||||
Subject: [PATCH 1/3] Revert "do not put <> in quotation marks"
|
||||
|
||||
This reverts commit a81bede998b510dadc79917b21e0a6dfbbc3436b.
|
||||
---
|
||||
configure.ac | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 8858a6d..754b8c9 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -196,14 +196,14 @@ AC_DEFINE(DEBUGGING,1,[Code will be built with debug info.])
|
||||
|
||||
AC_DEFINE(MAILARG,"/usr/sbin/sendmail",[There will be path to sendmail.])
|
||||
|
||||
-AC_DEFINE(MAILFMT,"%s -FCronDaemon -i -odi -oem -oi -t -f <>",
|
||||
+AC_DEFINE(MAILFMT,"%s -FCronDaemon -i -odi -oem -oi -t -f '<>'",
|
||||
[-i = don't terminate on "." by itself
|
||||
-Fx = Set full-name of sender
|
||||
-odi = Option Deliverymode Interactive
|
||||
-oem = Option Errors Mailedtosender
|
||||
-oi = Ignore "." alone on a line
|
||||
-t = Get recipient from headers
|
||||
--f <> = Empty envelope sender address
|
||||
+-f '<>' = Empty envelope sender address
|
||||
-d = undocumented but common flag.])
|
||||
|
||||
AC_DEFINE(SYSLOG,1,[Using syslog for log messages.])
|
||||
--
|
||||
2.52.0
|
||||
|
||||
50
0002-Revert-set-the-return-path-hard-to.patch
Normal file
50
0002-Revert-set-the-return-path-hard-to.patch
Normal file
@ -0,0 +1,50 @@
|
||||
From 4e8c767efb1bea03da465fee29641b65da1246eb Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Mraz <tmraz@fedoraproject.org>
|
||||
Date: Thu, 16 Nov 2023 18:01:12 +0100
|
||||
Subject: [PATCH 2/3] Revert "set the return-path hard to "<>""
|
||||
|
||||
This reverts commit d5d7db6a42f8c3ae6f6bd1efc767ae3fe97f4734.
|
||||
|
||||
This is problematic in some use-cases. It needs to be optional.
|
||||
---
|
||||
configure.ac | 4 ++--
|
||||
src/do_command.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 754b8c9..17fa357 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -196,14 +196,14 @@ AC_DEFINE(DEBUGGING,1,[Code will be built with debug info.])
|
||||
|
||||
AC_DEFINE(MAILARG,"/usr/sbin/sendmail",[There will be path to sendmail.])
|
||||
|
||||
-AC_DEFINE(MAILFMT,"%s -FCronDaemon -i -odi -oem -oi -t -f '<>'",
|
||||
+AC_DEFINE(MAILFMT,"%s -FCronDaemon -i -odi -oem -oi -t -f %s",
|
||||
[-i = don't terminate on "." by itself
|
||||
-Fx = Set full-name of sender
|
||||
-odi = Option Deliverymode Interactive
|
||||
-oem = Option Errors Mailedtosender
|
||||
-oi = Ignore "." alone on a line
|
||||
-t = Get recipient from headers
|
||||
--f '<>' = Empty envelope sender address
|
||||
+-f %s = Envelope sender address
|
||||
-d = undocumented but common flag.])
|
||||
|
||||
AC_DEFINE(SYSLOG,1,[Using syslog for log messages.])
|
||||
diff --git a/src/do_command.c b/src/do_command.c
|
||||
index 665e1f0..8226a69 100644
|
||||
--- a/src/do_command.c
|
||||
+++ b/src/do_command.c
|
||||
@@ -471,7 +471,7 @@ static int child_process(entry * e, char **jobenv) {
|
||||
if (MailCmd[0] == '\0') {
|
||||
int len;
|
||||
|
||||
- len = snprintf(mailcmd, sizeof mailcmd, MAILFMT, MAILARG);
|
||||
+ len = snprintf(mailcmd, sizeof mailcmd, MAILFMT, MAILARG, mailfrom);
|
||||
if (len < 0) {
|
||||
fprintf(stderr, "mailcmd snprintf failed\n");
|
||||
(void) _exit(ERROR_EXIT);
|
||||
--
|
||||
2.52.0
|
||||
|
||||
31
0003-Use-empty-envelope-address-with-default-mailfrom.patch
Normal file
31
0003-Use-empty-envelope-address-with-default-mailfrom.patch
Normal file
@ -0,0 +1,31 @@
|
||||
From c640f4f39e5c20995e960e4b954cd0574a96c028 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Mraz <tmraz@fedoraproject.org>
|
||||
Date: Thu, 16 Nov 2023 18:12:12 +0100
|
||||
Subject: [PATCH 3/3] Use empty envelope address with default mailfrom
|
||||
|
||||
This should still reasonably fix the issue resolved in
|
||||
https://github.com/cronie-crond/cronie/pull/118
|
||||
But it would provide normal envelope address if
|
||||
MAILFROM is explicitly set.
|
||||
---
|
||||
src/do_command.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/do_command.c b/src/do_command.c
|
||||
index 8226a69..d7ca840 100644
|
||||
--- a/src/do_command.c
|
||||
+++ b/src/do_command.c
|
||||
@@ -471,7 +471,9 @@ static int child_process(entry * e, char **jobenv) {
|
||||
if (MailCmd[0] == '\0') {
|
||||
int len;
|
||||
|
||||
- len = snprintf(mailcmd, sizeof mailcmd, MAILFMT, MAILARG, mailfrom);
|
||||
+ /* Use empty envelope address with default mailfrom */
|
||||
+ len = snprintf(mailcmd, sizeof mailcmd, MAILFMT, MAILARG,
|
||||
+ mailfrom == e->pwd->pw_name ? "<>" : mailfrom);
|
||||
if (len < 0) {
|
||||
fprintf(stderr, "mailcmd snprintf failed\n");
|
||||
(void) _exit(ERROR_EXIT);
|
||||
--
|
||||
2.52.0
|
||||
|
||||
@ -33,6 +33,13 @@ Patch: 0001-crontab-Fix-backup-failure-when-cache-directory-mis.patch
|
||||
# https://github.com/cronie-crond/cronie/pull/210
|
||||
Patch: forward-XDG_SESSION_CLASS-to-PAM-for-session-classification.patch
|
||||
|
||||
# https://github.com/cronie-crond/cronie/issues/166
|
||||
# two of these patches touched configure.ac, so we need 'automake'as a BuildRequires
|
||||
# it is safe to remove it once these patches are part of the upstream release
|
||||
Patch: 0001-Revert-do-not-put-in-quotation-marks.patch
|
||||
Patch: 0002-Revert-set-the-return-path-hard-to.patch
|
||||
Patch: 0003-Use-empty-envelope-address-with-default-mailfrom.patch
|
||||
|
||||
Requires: dailyjobs
|
||||
|
||||
%if %{with selinux}
|
||||
@ -50,6 +57,7 @@ Buildrequires: audit-libs-devel >= 1.4.1
|
||||
BuildRequires: gcc
|
||||
BuildRequires: systemd
|
||||
BuildRequires: make
|
||||
BuildRequires: automake
|
||||
Obsoletes: %{name}-sysvinit
|
||||
|
||||
Requires(post): coreutils sed
|
||||
|
||||
Loading…
Reference in New Issue
Block a user