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