libreport/0003-reporter-mailx-set-sendwait-1-in-environment.patch
2011-10-03 10:22:02 +02:00

34 lines
1.1 KiB
Diff

From fff24fb47435200ce6b51de9c43fe0c6d61c93d0 Mon Sep 17 00:00:00 2001
From: Denys Vlasenko <dvlasenk@redhat.com>
Date: Fri, 30 Sep 2011 19:13:48 +0200
Subject: [PATCH 3/4] reporter-mailx: set sendwait=1 in environment.
This might improve error detection in sending emails
Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
---
src/plugins/reporter-mailx.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/src/plugins/reporter-mailx.c b/src/plugins/reporter-mailx.c
index 8e5ff41..ae7f774 100644
--- a/src/plugins/reporter-mailx.c
+++ b/src/plugins/reporter-mailx.c
@@ -99,6 +99,13 @@ static void create_and_send_email(
args = append_str_to_vector(args, &arg_size, email_from);
args = append_str_to_vector(args, &arg_size, email_to);
+ /* This makes (some versions of) mailx to wait for child process to finish,
+ * and to report its exit code, not useless "always 0" exit code.
+ * Sadly, usually this still doesn't help. See:
+ * https://bugzilla.redhat.com/show_bug.cgi?id=740895
+ */
+ putenv((char*)"sendwait=1");
+
log(_("Sending an email..."));
exec_and_feed_input(dsc, args);
--
1.7.6.4