Blame SOURCES/0207-mailx-stop-creating-dead.letter-on-mailx-failures.patch

4b6aa8
From 438579dd448f220aea0f9d99cabf01a253b999ba Mon Sep 17 00:00:00 2001
4b6aa8
From: Matej Habrnal <mhabrnal@redhat.com>
4b6aa8
Date: Mon, 11 Apr 2016 11:05:57 +0200
4b6aa8
Subject: [PATCH] mailx: stop creating dead.letter on mailx failures
4b6aa8
4b6aa8
SELinux does not like mailx creating the file and I do not see any
4b6aa8
reason to create the file in a problem directory because the file
4b6aa8
contains a copy of the email that could not be send.
4b6aa8
4b6aa8
Failures of EVENT=notify are discoverable in system logs and if you run
4b6aa8
the reporter manually, you will see that mailx failed.
4b6aa8
4b6aa8
Resolves #1309317
4b6aa8
4b6aa8
Signed-off-by: Jakub Filak <jfilak@redhat.com>
4b6aa8
---
4b6aa8
 src/plugins/reporter-mailx.c | 6 ++++++
4b6aa8
 1 file changed, 6 insertions(+)
4b6aa8
4b6aa8
diff --git a/src/plugins/reporter-mailx.c b/src/plugins/reporter-mailx.c
4b6aa8
index feeb900..19013a5 100644
4b6aa8
--- a/src/plugins/reporter-mailx.c
4b6aa8
+++ b/src/plugins/reporter-mailx.c
4b6aa8
@@ -197,6 +197,12 @@ static void create_and_send_email(
4b6aa8
      */
4b6aa8
     putenv((char*)"sendwait=1");
4b6aa8
 
4b6aa8
+    /* Prevent mailx from creating dead.letter if sending fails. The file is
4b6aa8
+     * useless in our case and if the reporter is called from abrtd, SELinux
4b6aa8
+     * complains a lot about mailx touching ABRT data.
4b6aa8
+     */
4b6aa8
+    putenv((char*)"DEAD=/dev/null");
4b6aa8
+
4b6aa8
     log(_("Sending an email..."));
4b6aa8
 
4b6aa8
     if (flag & RM_FLAG_NOTIFY)
4b6aa8
-- 
4b6aa8
1.8.3.1
4b6aa8